summaryrefslogtreecommitdiffstats
path: root/content/browser/appcache/appcache_entry.h
diff options
context:
space:
mode:
authorpilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 20:57:55 +0000
committerpilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-25 20:57:55 +0000
commit98d6d4562142f682d3bc8419c0f29a4f7fd0f263 (patch)
tree005b061e143cefc1d2c890a700b28edb57b8573d /content/browser/appcache/appcache_entry.h
parent0282b03c86d52533c58af2c6e8de4c7bc7a89155 (diff)
downloadchromium_src-98d6d4562142f682d3bc8419c0f29a4f7fd0f263.zip
chromium_src-98d6d4562142f682d3bc8419c0f29a4f7fd0f263.tar.gz
chromium_src-98d6d4562142f682d3bc8419c0f29a4f7fd0f263.tar.bz2
Move all remaining appcache-related code to content namespace
This introduces NO FUNCTIONAL CHANGES. It is strictly a file move and namespace change. BUG=338338 R=michaeln@chromium.org TBR=cevans, darin Review URL: https://codereview.chromium.org/344493002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/appcache/appcache_entry.h')
-rw-r--r--content/browser/appcache/appcache_entry.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/content/browser/appcache/appcache_entry.h b/content/browser/appcache/appcache_entry.h
new file mode 100644
index 0000000..5c4fffd
--- /dev/null
+++ b/content/browser/appcache/appcache_entry.h
@@ -0,0 +1,67 @@
+// Copyright (c) 2009 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_ENTRY_H_
+#define CONTENT_BROWSER_APPCACHE_APPCACHE_ENTRY_H_
+
+#include "content/common/appcache_interfaces.h"
+
+namespace content {
+
+// A cached entry is identified by a URL and is classified into one
+// (or more) categories. URL is not stored here as this class is stored
+// with the URL as a map key or the user of this class already knows the URL.
+class AppCacheEntry {
+ public:
+
+ // An entry can be of more than one type so use a bitmask.
+ // Note: These bit values are stored on disk.
+ enum Type {
+ MASTER = 1 << 0,
+ MANIFEST = 1 << 1,
+ EXPLICIT = 1 << 2,
+ FOREIGN = 1 << 3,
+ FALLBACK = 1 << 4,
+ INTERCEPT = 1 << 5,
+ EXECUTABLE = 1 << 6,
+ };
+
+ AppCacheEntry()
+ : types_(0), response_id_(kAppCacheNoResponseId), response_size_(0) {}
+
+ explicit AppCacheEntry(int type)
+ : types_(type), response_id_(kAppCacheNoResponseId), response_size_(0) {}
+
+ AppCacheEntry(int type, int64 response_id)
+ : types_(type), response_id_(response_id), response_size_(0) {}
+
+ AppCacheEntry(int type, int64 response_id, int64 response_size)
+ : types_(type), response_id_(response_id), response_size_(response_size) {}
+
+ int types() const { return types_; }
+ void add_types(int added_types) { types_ |= added_types; }
+ bool IsMaster() const { return (types_ & MASTER) != 0; }
+ bool IsManifest() const { return (types_ & MANIFEST) != 0; }
+ bool IsExplicit() const { return (types_ & EXPLICIT) != 0; }
+ bool IsForeign() const { return (types_ & FOREIGN) != 0; }
+ bool IsFallback() const { return (types_ & FALLBACK) != 0; }
+ bool IsIntercept() const { return (types_ & INTERCEPT) != 0; }
+ bool IsExecutable() const { return (types_ & EXECUTABLE) != 0; }
+
+ int64 response_id() const { return response_id_; }
+ void set_response_id(int64 id) { response_id_ = id; }
+ bool has_response_id() const { return response_id_ != kAppCacheNoResponseId; }
+
+ int64 response_size() const { return response_size_; }
+ void set_response_size(int64 size) { response_size_ = size; }
+
+ private:
+ int types_;
+ int64 response_id_;
+ int64 response_size_;
+};
+
+} // namespace content
+
+#endif // WEBKIT_APPCACHE_APPCACHE_RESOURCE_H_