diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 23:52:47 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 23:52:47 +0000 |
commit | 032dea757076b465d613314736095ce82c542c1b (patch) | |
tree | 584cf2e9705569998e6f8a928dc83adf6d27ca7b /webkit | |
parent | d7a18ecba12b794e797762a701b96bed84467dcb (diff) | |
download | chromium_src-032dea757076b465d613314736095ce82c542c1b.zip chromium_src-032dea757076b465d613314736095ce82c542c1b.tar.gz chromium_src-032dea757076b465d613314736095ce82c542c1b.tar.bz2 |
Ground work for making appcaches work in workers.
Add ResourceRequest target types for worker and shared worker resources. This is the first patch of a two-sided change that involves WebKit API changes which haven't been made yet.
BUG=39368
TEST=none
Review URL: http://codereview.chromium.org/1666002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/resource_type.h | 9 | ||||
-rw-r--r-- | webkit/glue/weburlloader_impl.cc | 8 |
2 files changed, 15 insertions, 2 deletions
diff --git a/webkit/glue/resource_type.h b/webkit/glue/resource_type.h index 14f228b..140282a 100644 --- a/webkit/glue/resource_type.h +++ b/webkit/glue/resource_type.h @@ -20,6 +20,8 @@ class ResourceType { OBJECT, // an object (or embed) tag for a plugin, // or a resource that a plugin requested. MEDIA, // a media resource. + SHARED_WORKER, // the main resource of a shared worker. + WORKER, // the main resource of a dedicated worker. LAST_TYPE // Place holder so we don't need to change ValidType // everytime. }; @@ -36,12 +38,17 @@ class ResourceType { return type == MAIN_FRAME || type == SUB_FRAME; } + static bool IsSharedWorker(ResourceType::Type type) { + return type == SHARED_WORKER; + } + static bool IsSubresource(ResourceType::Type type) { return type == STYLESHEET || type == SCRIPT || type == IMAGE || type == FONT_RESOURCE || - type == SUB_RESOURCE; + type == SUB_RESOURCE || + type == WORKER; } private: diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index d1d17a4..710a84b 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.cc @@ -124,8 +124,14 @@ ResourceType::Type FromTargetType(WebURLRequest::TargetType type) { return ResourceType::OBJECT; case WebURLRequest::TargetIsMedia: return ResourceType::MEDIA; + // TODO(michaeln): uncomment the following cases and the NOTREACHED() call + // when the webkit API has been committed and these constants are defined. + // case WebURLRequest::TargetIsWorker: + // return ResourceType::WORKER; + // case WebURLRequest::TargetIsSharedWorker: + // return ResourceType::SHARED_WORKER; default: - NOTREACHED(); + // NOTREACHED(); return ResourceType::SUB_RESOURCE; } } |