diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 20:51:06 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 20:51:06 +0000 |
commit | 15f9cdedac1784a85dca7867858c905f0ed90d2b (patch) | |
tree | bb001e718240c0fd86aa43a55f4a76e978b72880 /webkit/appcache/appcache_host.h | |
parent | b89f7e4d3f98fffe88bd07a57c735e28c37e692c (diff) | |
download | chromium_src-15f9cdedac1784a85dca7867858c905f0ed90d2b.zip chromium_src-15f9cdedac1784a85dca7867858c905f0ed90d2b.tar.gz chromium_src-15f9cdedac1784a85dca7867858c905f0ed90d2b.tar.bz2 |
Finally getting to the appcache parts instead of all of this webkitApi/ipc plumbing craziness.
BUG=39368
TEST=new unittests
Review URL: http://codereview.chromium.org/2121002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.h')
-rw-r--r-- | webkit/appcache/appcache_host.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/webkit/appcache/appcache_host.h b/webkit/appcache/appcache_host.h index 2a2607e..1c7534f 100644 --- a/webkit/appcache/appcache_host.h +++ b/webkit/appcache/appcache_host.h @@ -14,6 +14,7 @@ #include "webkit/appcache/appcache_interfaces.h" #include "webkit/appcache/appcache_service.h" #include "webkit/appcache/appcache_storage.h" +#include "webkit/glue/resource_type.h" class URLRequest; @@ -56,6 +57,9 @@ class AppCacheHost : public AppCacheStorage::Delegate, void SelectCache(const GURL& document_url, const int64 cache_document_was_loaded_from, const GURL& manifest_url); + void SelectCacheForWorker(int parent_process_id, + int parent_host_id); + void SelectCacheForSharedWorker(int64 appcache_id); void MarkAsForeignEntry(const GURL& document_url, int64 cache_document_was_loaded_from); void GetStatusWithCallback(GetStatusCallback* callback, @@ -66,9 +70,9 @@ class AppCacheHost : public AppCacheStorage::Delegate, void* callback_param); // Support for loading resources out of the appcache. - // Returns NULL if the host is not associated with a complete cache. - AppCacheRequestHandler* CreateRequestHandler(URLRequest* request, - bool is_main_request); + // May return NULL if the request isn't subject to retrieval from an appache. + AppCacheRequestHandler* CreateRequestHandler( + URLRequest* request, ResourceType::Type resource_type); // Establishes an association between this host and a cache. 'cache' may be // NULL to break any existing association. Associations are established @@ -124,9 +128,26 @@ class AppCacheHost : public AppCacheStorage::Delegate, virtual void OnContentBlocked(AppCacheGroup* group); virtual void OnUpdateComplete(AppCacheGroup* group); + // Returns true if this host is for a dedicated worker context. + bool is_for_dedicated_worker() const { + return parent_host_id_ != kNoHostId; + } + + // Returns the parent context's host instance. This is only valid + // to call when this instance is_for_dedicated_worker. + AppCacheHost* GetParentAppCacheHost() const; + // Identifies the corresponding appcache host in the child process. int host_id_; + // Hosts for dedicated workers are special cased to shunt + // request handling off to the dedicated worker's parent. + // The scriptable api is not accessible in dedicated workers + // so the other aspects of this class are not relevant for + // these special case instances. + int parent_host_id_; + int parent_process_id_; + // The cache associated with this host, if any. scoped_refptr<AppCache> associated_cache_; @@ -190,6 +211,7 @@ class AppCacheHost : public AppCacheStorage::Delegate, FRIEND_TEST(AppCacheHostTest, FailedCacheLoad); FRIEND_TEST(AppCacheHostTest, FailedGroupLoad); FRIEND_TEST(AppCacheHostTest, SetSwappableCache); + FRIEND_TEST(AppCacheHostTest, ForDedicatedWorker); FRIEND_TEST(AppCacheGroupTest, QueueUpdate); DISALLOW_COPY_AND_ASSIGN(AppCacheHost); }; |