summaryrefslogtreecommitdiff
path: root/chromium/content/browser/appcache/appcache_namespace.h
blob: b08f9a4aed95a9c38b018d05144de3f139b13436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_NAMESPACE_H_
#define CONTENT_BROWSER_APPCACHE_APPCACHE_NAMESPACE_H_

#include "content/common/content_export.h"
#include "url/gurl.h"

namespace content {

enum AppCacheNamespaceType {
  APPCACHE_FALLBACK_NAMESPACE,
  APPCACHE_INTERCEPT_NAMESPACE,
  APPCACHE_NETWORK_NAMESPACE,
};

struct CONTENT_EXPORT AppCacheNamespace {
  AppCacheNamespace();  // Type is APPCACHE_FALLBACK_NAMESPACE by default.
  AppCacheNamespace(AppCacheNamespaceType type,
                    const GURL& url,
                    const GURL& target,
                    bool is_pattern);
  ~AppCacheNamespace();

  bool IsMatch(const GURL& url) const;

  AppCacheNamespaceType type;
  GURL namespace_url;
  GURL target_url;

  // TODO(jsbell): Remove pattern support, since it has been removed from the
  // parser already.
  bool is_pattern;
};

}  // namespace content

#endif  // CONTENT_BROWSER_APPCACHE_APPCACHE_NAMESPACE_H_