diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-22 18:31:42 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-22 18:31:42 +0000 |
commit | 756fbde6911d40d376680c7ab9b576620f64c108 (patch) | |
tree | db279a9daa90a0842a5eb035ffd6ec796ae851d2 /webkit/common | |
parent | 3b06f2ae871249581d6b4aeb47921f102b638156 (diff) | |
download | chromium_src-756fbde6911d40d376680c7ab9b576620f64c108.zip chromium_src-756fbde6911d40d376680c7ab9b576620f64c108.tar.gz chromium_src-756fbde6911d40d376680c7ab9b576620f64c108.tar.bz2 |
Move webkitplatformsupport_impl and related from glue to child
Picking up Ananta's change.
Move the webkitplatformsupport_impl.cc/.h files out of webkit\glue to
webkit\child.
This requires moving the following files out of webkit\glue to webkit\child:
1. weburlloader_impl.cc/.h
2. weburlrequest_extradata_impl.cc/.h
3. websocketstreamhandle_impl.cc/.h
4. weburlresponse_extradata_impl.cc/.h
5. websocketstreamhandle_delegate.h
6. ftp_directory_listing_response_delegate.cc/.h
7. multipart_response_delegate.cc/.h
8. multipart_response_delegate_unittest.cc
9. resource_loader_bridge.cc/.h
The following files have been moved to webkit\common:
2. resource_type.cc/.h
Move MemoryUsageKB out of webkit_glue.cc/h to webkit/child/webkit_child_helpers.
I added an include rule to content\common\DEPS to allow including
webkit\child\websocketstreamhandle_delegate.h. This will be removed in a
followup.
TBR=jam@chromium.org, jamesr@chromium.org, jschuh@chromium.org
BUG=237249
Review URL: https://codereview.chromium.org/19673002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212927 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/common')
-rw-r--r-- | webkit/common/resource_request_body.h | 2 | ||||
-rw-r--r-- | webkit/common/resource_type.cc | 47 | ||||
-rw-r--r-- | webkit/common/resource_type.h | 70 | ||||
-rw-r--r-- | webkit/common/webkit_common.gyp | 6 |
4 files changed, 122 insertions, 3 deletions
diff --git a/webkit/common/resource_request_body.h b/webkit/common/resource_request_body.h index 5c1edd1..c0bdc08 100644 --- a/webkit/common/resource_request_body.h +++ b/webkit/common/resource_request_body.h @@ -62,4 +62,4 @@ class WEBKIT_COMMON_EXPORT ResourceRequestBody } // namespace webkit_glue -#endif // WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ +#endif // WEBKIT_COMMON_RESOURCE_REQUEST_BODY_H_ diff --git a/webkit/common/resource_type.cc b/webkit/common/resource_type.cc new file mode 100644 index 0000000..2c416d3 --- /dev/null +++ b/webkit/common/resource_type.cc @@ -0,0 +1,47 @@ +// 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 WebKit::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; + default: + NOTREACHED(); + return ResourceType::SUB_RESOURCE; + } +} diff --git a/webkit/common/resource_type.h b/webkit/common/resource_type.h new file mode 100644 index 0000000..9ec7909 --- /dev/null +++ b/webkit/common/resource_type.h @@ -0,0 +1,70 @@ +// 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 + 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( + WebKit::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 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 e3b6579..af1c688 100644 --- a/webkit/common/webkit_common.gyp +++ b/webkit/common/webkit_common.gyp @@ -15,8 +15,8 @@ 'WEBKIT_COMMON_IMPLEMENTATION', ], 'dependencies': [ - '<(DEPTH)/base/base.gyp:base_i18n', '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/base/base.gyp:base_i18n', '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '<(DEPTH)/net/net.gyp:net', '<(DEPTH)/skia/skia.gyp:skia', @@ -39,10 +39,10 @@ 'cursors/webcursor_aura.cc', 'cursors/webcursor_aurawin.cc', 'cursors/webcursor_aurax11.cc', - 'cursors/webcursor_null.cc', 'cursors/webcursor_gtk.cc', 'cursors/webcursor_gtk_data.h', 'cursors/webcursor_mac.mm', + 'cursors/webcursor_null.cc', 'cursors/webcursor_win.cc', 'data_element.cc', 'data_element.h', @@ -52,6 +52,8 @@ 'resource_request_body.h', 'resource_response_info.cc', 'resource_response_info.h', + 'resource_type.cc', + 'resource_type.h', ], 'conditions': [ |