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_request_handler.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_request_handler.h')
-rw-r--r-- | webkit/appcache/appcache_request_handler.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/webkit/appcache/appcache_request_handler.h b/webkit/appcache/appcache_request_handler.h index 3a4c057..77613f8 100644 --- a/webkit/appcache/appcache_request_handler.h +++ b/webkit/appcache/appcache_request_handler.h @@ -8,6 +8,7 @@ #include "net/url_request/url_request.h" #include "webkit/appcache/appcache_entry.h" #include "webkit/appcache/appcache_host.h" +#include "webkit/glue/resource_type.h" class URLRequest; class URLRequestJob; @@ -35,11 +36,16 @@ class AppCacheRequestHandler : public URLRequest::UserData, void GetExtraResponseInfo(int64* cache_id, GURL* manifest_url); + static bool IsMainResourceType(ResourceType::Type type) { + return ResourceType::IsFrame(type) || + ResourceType::IsSharedWorker(type); + } + private: friend class AppCacheHost; // Callers should use AppCacheHost::CreateRequestHandler. - AppCacheRequestHandler(AppCacheHost* host, bool is_main_resource); + AppCacheRequestHandler(AppCacheHost* host, ResourceType::Type resource_type); // AppCacheHost::Observer override virtual void OnDestructionImminent(AppCacheHost* host); @@ -52,9 +58,14 @@ class AppCacheRequestHandler : public URLRequest::UserData, void DeliverErrorResponse(); // Helper to retrieve a pointer to the storage object. - AppCacheStorage* storage(); + AppCacheStorage* storage() const; + + bool is_main_resource() const { + return IsMainResourceType(resource_type_); + } // Main-resource loading ------------------------------------- + // Frame and SharedWorker main resources are handled here. void MaybeLoadMainResource(URLRequest* request); @@ -66,6 +77,7 @@ class AppCacheRequestHandler : public URLRequest::UserData, bool was_blocked_by_policy); // Sub-resource loading ------------------------------------- + // Dedicated worker and all manner of sub-resources are handled here. void MaybeLoadSubResource(URLRequest* request); void ContinueMaybeLoadSubResource(); @@ -78,8 +90,8 @@ class AppCacheRequestHandler : public URLRequest::UserData, // What host we're servicing a request for. AppCacheHost* host_; - // Main vs subresource loads are somewhat different. - bool is_main_request_; + // Frame vs subresource vs sharedworker loads are somewhat different. + ResourceType::Type resource_type_; // Subresource requests wait until after cache selection completes. bool is_waiting_for_cache_selection_; |