summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_thread.h
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 22:34:24 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 22:34:24 +0000
commitd2896ea20748e43560e4b38a3fcb33154a5da23b (patch)
treeb712b98bcb80dda24aaf758c08a9ed8413d1d8a0 /webkit/appcache/appcache_thread.h
parent30bf9fd6ad27d43208f8b48a927fa713ac6bd285 (diff)
downloadchromium_src-d2896ea20748e43560e4b38a3fcb33154a5da23b.zip
chromium_src-d2896ea20748e43560e4b38a3fcb33154a5da23b.tar.gz
chromium_src-d2896ea20748e43560e4b38a3fcb33154a5da23b.tar.bz2
Plumbing for providing a cache thread MessageLoop to the DiskCache backend.
BUG=26730 TEST=none Review URL: http://codereview.chromium.org/1115002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_thread.h')
-rw-r--r--webkit/appcache/appcache_thread.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/webkit/appcache/appcache_thread.h b/webkit/appcache/appcache_thread.h
index 7224d23..7a0a70c 100644
--- a/webkit/appcache/appcache_thread.h
+++ b/webkit/appcache/appcache_thread.h
@@ -11,21 +11,27 @@ namespace tracked_objects {
class Location;
}
+class MessageLoop;
+
namespace appcache {
// The appcache system uses two threads, an IO thread and a DB thread.
// It does not create these threads, the embedder is responsible for
// providing them to the appcache library by providing a concrete
// implementation of the PostTask and CurrentlyOn methods declared here,
-// and by calling the InitIDs method prior to using the appcache library.
+// and by calling the Init method prior to using the appcache library.
+// The disk_cache also requires the embedder to provide a thread message
+// loop.
class AppCacheThread {
public:
- static void InitIDs(int db, int io) {
+ static void Init(int db, int io, MessageLoop* disk_cache_thread) {
db_ = db;
io_ = io;
+ disk_cache_thread_ = disk_cache_thread;
}
static int db() { return db_; }
static int io() { return io_; }
+ static MessageLoop* disk_cache_thread() { return disk_cache_thread_; }
static bool PostTask(int id,
const tracked_objects::Location& from_here,
@@ -45,6 +51,7 @@ class AppCacheThread {
static int db_;
static int io_;
+ static MessageLoop* disk_cache_thread_;
};
} // namespace appcache