summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_entry.h
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 23:10:09 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 23:10:09 +0000
commit49672df7e74a0633a0ee92e89b4daff904765638 (patch)
treede848215c76faf23ad3e99d456b8a056c8e61491 /webkit/appcache/appcache_entry.h
parentc21b90496d356e5d8e56231dc8c4d4962a67f117 (diff)
downloadchromium_src-49672df7e74a0633a0ee92e89b4daff904765638.zip
chromium_src-49672df7e74a0633a0ee92e89b4daff904765638.tar.gz
chromium_src-49672df7e74a0633a0ee92e89b4daff904765638.tar.bz2
Skeleton classes for appcache library framework. This is a work in progress. Committing early to allow other code to use these objects, but still need to consider refptrs and add unittests.
TEST=none (will add when classes are fleshed out more) BUG=none Review URL: http://codereview.chromium.org/174034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24554 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_entry.h')
-rw-r--r--webkit/appcache/appcache_entry.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_entry.h b/webkit/appcache/appcache_entry.h
new file mode 100644
index 0000000..5629cc2
--- /dev/null
+++ b/webkit/appcache/appcache_entry.h
@@ -0,0 +1,45 @@
+// 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 WEBKIT_APPCACHE_APPCACHE_ENTRY_H_
+#define WEBKIT_APPCACHE_APPCACHE_ENTRY_H_
+
+#include "googleurl/src/gurl.h"
+
+namespace appcache {
+
+// 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.
+ enum Type {
+ MASTER = 1 << 0,
+ MANIFEST = 1 << 1,
+ EXPLICIT = 1 << 2,
+ FOREIGN = 1 << 3,
+ FALLBACK = 1 << 4,
+ };
+
+ explicit AppCacheEntry(int type) : types_(type) {}
+
+ int types() const { return types_; }
+ void add_types(int added_types) { types_ |= added_types; }
+ bool IsMaster() const { return types_ & MASTER; }
+ bool IsManifest() const { return types_ & MANIFEST; }
+ bool IsExplicit() const { return types_ & EXPLICIT; }
+ bool IsForeign() const { return types_ & FOREIGN; }
+ bool IsFallback() const { return types_ & FALLBACK; }
+
+ private:
+ int types_;
+
+ // TODO(jennb): response storage key
+};
+
+} // namespace appcache
+
+#endif // WEBKIT_APPCACHE_APPCACHE_RESOURCE_H_