summaryrefslogtreecommitdiff
path: root/chromium/content/browser/appcache/appcache_namespace.h
blob: 8e4f8cef5e640bc0ccea7f9103e19ab023ffd7f9 (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
// 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 "base/time/time.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);
  ~AppCacheNamespace();

  bool IsMatch(const GURL& url) const;

  AppCacheNamespaceType type;
  GURL namespace_url;
  GURL target_url;
  base::Time token_expires;
};

}  // namespace content

#endif  // CONTENT_BROWSER_APPCACHE_APPCACHE_NAMESPACE_H_