Index: content/public/common/resource_type.h |
diff --git a/content/public/common/resource_type.h b/content/public/common/resource_type.h |
index 92d17eb59e74bc65742b76c5fb09dced3774fc85..f71d953df4e4295a65554ed0554fae5b45ba8bd1 100644 |
--- a/content/public/common/resource_type.h |
+++ b/content/public/common/resource_type.h |
@@ -5,74 +5,35 @@ |
#ifndef CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |
#define CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |
-#include "base/macros.h" |
#include "content/common/content_export.h" |
-#include "third_party/WebKit/public/platform/WebURLRequest.h" |
namespace content { |
-class CONTENT_EXPORT ResourceType { |
- public: |
- // Used in histograms, so please add new types at the end, and rename unused |
- // entries to RESOURCETYPE_UNUSED_0, etc... |
- enum Type { |
- MAIN_FRAME = 0, // top level page |
- SUB_FRAME, // frame or iframe |
- STYLESHEET, // a CSS stylesheet |
- SCRIPT, // an external script |
- IMAGE, // an image (jpg/gif/png/etc) |
- FONT_RESOURCE, // a font |
- SUB_RESOURCE, // an "other" subresource. |
- OBJECT, // an object (or embed) tag for a plugin, |
- // or a resource that a plugin requested. |
- MEDIA, // a media resource. |
- WORKER, // the main resource of a dedicated worker. |
- SHARED_WORKER, // the main resource of a shared worker. |
- PREFETCH, // an explicitly requested prefetch |
- FAVICON, // a favicon |
- XHR, // a XMLHttpRequest |
- PING, // a ping request for <a ping> |
- SERVICE_WORKER, // the main resource of a service worker. |
- LAST_TYPE // Place holder so we don't need to change ValidType |
- // everytime. |
- }; |
- |
- static Type FromWebURLRequest(const blink::WebURLRequest& request); |
- |
- static bool ValidType(int32 type) { |
- return type >= MAIN_FRAME && type < LAST_TYPE; |
- } |
- |
- static Type FromInt(int32 type) { |
- return static_cast<Type>(type); |
- } |
- |
- static bool IsFrame(ResourceType::Type type) { |
- return type == MAIN_FRAME || type == SUB_FRAME; |
- } |
- |
- static bool IsSharedWorker(ResourceType::Type type) { |
- return type == SHARED_WORKER; |
- } |
- |
- static bool IsServiceWorker(ResourceType::Type type) { |
- return type == SERVICE_WORKER; |
- } |
- |
- static bool IsSubresource(ResourceType::Type type) { |
- return type == STYLESHEET || |
- type == SCRIPT || |
- type == IMAGE || |
- type == FONT_RESOURCE || |
- type == SUB_RESOURCE || |
- type == WORKER || |
- type == XHR; |
- } |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(ResourceType); |
+// Used in histograms, so please add new types at the end, and rename unused |
+// entries to RESOURCETYPE_UNUSED_0, etc... |
+enum ResourceType { |
+ RESOURCE_TYPE_MAIN_FRAME = 0, // top level page |
+ RESOURCE_TYPE_SUB_FRAME, // frame or iframe |
+ RESOURCE_TYPE_STYLESHEET, // a CSS stylesheet |
+ RESOURCE_TYPE_SCRIPT, // an external script |
+ RESOURCE_TYPE_IMAGE, // an image (jpg/gif/png/etc) |
+ RESOURCE_TYPE_FONT_RESOURCE, // a font |
+ RESOURCE_TYPE_SUB_RESOURCE, // an "other" subresource. |
+ RESOURCE_TYPE_OBJECT, // an object (or embed) tag for a plugin, |
+ // or a resource that a plugin requested. |
+ RESOURCE_TYPE_MEDIA, // a media resource. |
+ RESOURCE_TYPE_WORKER, // the main resource of a dedicated worker. |
+ RESOURCE_TYPE_SHARED_WORKER, // the main resource of a shared worker. |
+ RESOURCE_TYPE_PREFETCH, // an explicitly requested prefetch |
+ RESOURCE_TYPE_FAVICON, // a favicon |
+ RESOURCE_TYPE_XHR, // a XMLHttpRequest |
+ RESOURCE_TYPE_PING, // a ping request for <a ping> |
+ RESOURCE_TYPE_SERVICE_WORKER, // the main resource of a service worker. |
+ RESOURCE_TYPE_LAST_TYPE |
}; |
+CONTENT_EXPORT bool IsResourceTypeFrame(ResourceType type); |
+ |
} // namespace content |
#endif // CONTENT_PUBLIC_COMMON_RESOURCE_TYPE_H_ |