diff options
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; } } |