summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_service.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_service.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_service.h')
-rw-r--r--webkit/appcache/appcache_service.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_service.h b/webkit/appcache/appcache_service.h
new file mode 100644
index 0000000..3eaa43d
--- /dev/null
+++ b/webkit/appcache/appcache_service.h
@@ -0,0 +1,60 @@
+// 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_SERVICE_H_
+#define WEBKIT_APPCACHE_APPCACHE_SERVICE_H_
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "base/hash_tables.h"
+#include "googleurl/src/gurl.h"
+
+namespace appcache {
+
+class AppCache;
+class AppCacheBackendImpl;
+class AppCacheGroup;
+
+// Class that manages the application cache service. Sends notifications
+// to many frontends. One instance per user-profile.
+class AppCacheService {
+ public:
+ virtual ~AppCacheService();
+
+ // TODO(jennb): API to set service settings, like file paths for storage
+
+ // track which processes are using this appcache service
+ void RegisterBackendImpl(AppCacheBackendImpl* backend_impl);
+ void UnregisterBackendImpl(AppCacheBackendImpl* backend_impl);
+
+ void AddCache(AppCache* cache);
+ void RemoveCache(AppCache* cache);
+ void AddGroup(AppCacheGroup* group);
+ void RemoveGroup(AppCacheGroup* group);
+
+ private:
+ // In-memory representation of stored appcache data. Represents a subset
+ // of the appcache database currently in use.
+ typedef base::hash_map<int64, AppCache*> CacheMap;
+ typedef std::map<GURL, AppCacheGroup*> GroupMap;
+ CacheMap caches_;
+ GroupMap groups_;
+
+ // Track current processes. One 'backend' per child process.
+ typedef std::set<AppCacheBackendImpl*> BackendSet;
+ BackendSet backends_;
+
+ // TODO(jennb): info about appcache storage
+ // AppCacheDatabase db_;
+ // DiskCache response_storage_;
+
+ // TODO(jennb): service settings: e.g. max size of app cache?
+ // TODO(jennb): service state: e.g. reached quota?
+};
+
+} // namespace appcache
+
+#endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_