diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-05 19:10:07 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-05 19:10:07 +0000 |
commit | 7491ad09fcd97ef2341dd5c7df380287f97bd128 (patch) | |
tree | f5f6fc0a6a4b559877e0b6649a4fe5df2aa8a05f /webkit | |
parent | 63d1f9b9a1fb0e67739fdfe59d4aa5a978bf95ac (diff) | |
download | chromium_src-7491ad09fcd97ef2341dd5c7df380287f97bd128.zip chromium_src-7491ad09fcd97ef2341dd5c7df380287f97bd128.tar.gz chromium_src-7491ad09fcd97ef2341dd5c7df380287f97bd128.tar.bz2 |
Move resource_type.* from webkit/ to content/.
Put it in content namespace while doing this.
BUG=338338
TEST=None
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/370833002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/common/BUILD.gn | 2 | ||||
-rw-r--r-- | webkit/common/resource_type.cc | 51 | ||||
-rw-r--r-- | webkit/common/resource_type.h | 76 | ||||
-rw-r--r-- | webkit/common/webkit_common.gyp | 2 |
4 files changed, 0 insertions, 131 deletions
diff --git a/webkit/common/BUILD.gn b/webkit/common/BUILD.gn index 37f6634..9de080f 100644 --- a/webkit/common/BUILD.gn +++ b/webkit/common/BUILD.gn @@ -9,8 +9,6 @@ component("common") { sources = [ "data_element.cc", "data_element.h", - "resource_type.cc", - "resource_type.h", "webkit_common_export.h", "webpreferences.cc", "webpreferences.h", diff --git a/webkit/common/resource_type.cc b/webkit/common/resource_type.cc deleted file mode 100644 index 7e938db..0000000 --- a/webkit/common/resource_type.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/common/resource_type.h" - -#include "base/logging.h" - -using blink::WebURLRequest; - -// static -ResourceType::Type ResourceType::FromTargetType( - WebURLRequest::TargetType type) { - switch (type) { - case WebURLRequest::TargetIsMainFrame: - return ResourceType::MAIN_FRAME; - case WebURLRequest::TargetIsSubframe: - return ResourceType::SUB_FRAME; - case WebURLRequest::TargetIsSubresource: - return ResourceType::SUB_RESOURCE; - case WebURLRequest::TargetIsStyleSheet: - return ResourceType::STYLESHEET; - case WebURLRequest::TargetIsScript: - return ResourceType::SCRIPT; - case WebURLRequest::TargetIsFontResource: - return ResourceType::FONT_RESOURCE; - case WebURLRequest::TargetIsImage: - return ResourceType::IMAGE; - case WebURLRequest::TargetIsObject: - return ResourceType::OBJECT; - case WebURLRequest::TargetIsMedia: - return ResourceType::MEDIA; - case WebURLRequest::TargetIsWorker: - return ResourceType::WORKER; - case WebURLRequest::TargetIsSharedWorker: - return ResourceType::SHARED_WORKER; - case WebURLRequest::TargetIsPrefetch: - return ResourceType::PREFETCH; - case WebURLRequest::TargetIsFavicon: - return ResourceType::FAVICON; - case WebURLRequest::TargetIsXHR: - return ResourceType::XHR; - case WebURLRequest::TargetIsPing: - return ResourceType::PING; - case WebURLRequest::TargetIsServiceWorker: - return ResourceType::SERVICE_WORKER; - default: - NOTREACHED(); - return ResourceType::SUB_RESOURCE; - } -} diff --git a/webkit/common/resource_type.h b/webkit/common/resource_type.h deleted file mode 100644 index 4cfd0f6e..0000000 --- a/webkit/common/resource_type.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_COMMON_RESOURCE_TYPE_H__ -#define WEBKIT_COMMON_RESOURCE_TYPE_H__ - -#include "base/basictypes.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "webkit/common/webkit_common_export.h" - -class 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 bool ValidType(int32 type) { - return type >= MAIN_FRAME && type < LAST_TYPE; - } - - static Type FromInt(int32 type) { - return static_cast<Type>(type); - } - - WEBKIT_COMMON_EXPORT static Type FromTargetType( - blink::WebURLRequest::TargetType 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: - // Don't instantiate this class. - ResourceType(); - ~ResourceType(); -}; -#endif // WEBKIT_COMMON_RESOURCE_TYPE_H__ diff --git a/webkit/common/webkit_common.gyp b/webkit/common/webkit_common.gyp index 5e3e8b8..5710b37 100644 --- a/webkit/common/webkit_common.gyp +++ b/webkit/common/webkit_common.gyp @@ -42,8 +42,6 @@ 'sources': [ 'data_element.cc', 'data_element.h', - 'resource_type.cc', - 'resource_type.h', 'webkit_common_export.h', 'webpreferences.cc', 'webpreferences.h', |