summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 00:59:40 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-31 00:59:40 +0000
commit6c1e05217fb089245b77e39fd6a46f26c4b85e54 (patch)
tree770ce08ff82343a522b92e37558faa1aff8e4804 /android_webview
parent1ecda815adaacdc68dc7769c1f34d5182799abc4 (diff)
downloadchromium_src-6c1e05217fb089245b77e39fd6a46f26c4b85e54.zip
chromium_src-6c1e05217fb089245b77e39fd6a46f26c4b85e54.tar.gz
chromium_src-6c1e05217fb089245b77e39fd6a46f26c4b85e54.tar.bz2
content: ResourceType cleanup.
0) Converted the ResourceType::Type enum to ResourceType enum in content namespace, like this: enum ResourceType { RESOURCE_TYPE_MAIN_FRAME = 0, //... RESOURCE_TYPE_SUB_FRAME, // ... RESOURCE_TYPE_STYLESHEET, // ... . . . }; 1) FromWebURLRequest() is is only called from within content (child & renderer), moved into content/child/web_url_request_util.* and renamed to WebURLRequestToResourceType(). 2) ValidType/FromInt/IsSubresource aren't called from anywhere. Removed. 3) IsSharedWorker/IsServiceWorker are not necessary, they're just an enum comparison and are only called in 5 places. Removed them and just the if check directly. -IsFrame is called in a number of places. Leave it in this header as a function. Since it's not scoped in a class anymore, it needs a more descriptive name. Renamed to IsResourceTypeFrame(). BUG=None TEST=None R=jam@chromium.org TBR=darin@chromium # trivial changes all around src/ Review URL: https://codereview.chromium.org/425653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/browser/aw_content_browser_client.cc2
-rw-r--r--android_webview/browser/aw_content_browser_client.h2
-rw-r--r--android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc12
-rw-r--r--android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h2
-rw-r--r--android_webview/native/aw_contents_io_thread_client_impl.cc2
5 files changed, 11 insertions, 9 deletions
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc
index 44a8bc7..000a09b 100644
--- a/android_webview/browser/aw_content_browser_client.cc
+++ b/android_webview/browser/aw_content_browser_client.cc
@@ -361,7 +361,7 @@ void AwContentBrowserClient::AllowCertificateError(
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
- ResourceType::Type resource_type,
+ ResourceType resource_type,
bool overridable,
bool strict_enforcement,
const base::Callback<void(bool)>& callback,
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h
index 21d954b..d6b9ec5 100644
--- a/android_webview/browser/aw_content_browser_client.h
+++ b/android_webview/browser/aw_content_browser_client.h
@@ -97,7 +97,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
- content::ResourceType::Type resource_type,
+ content::ResourceType resource_type,
bool overridable,
bool strict_enforcement,
const base::Callback<void(bool)>& callback,
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index 981acf5..f55b36a 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -211,7 +211,7 @@ void AwResourceDispatcherHostDelegate::RequestBeginning(
net::URLRequest* request,
content::ResourceContext* resource_context,
content::AppCacheService* appcache_service,
- ResourceType::Type resource_type,
+ ResourceType resource_type,
int child_id,
int route_id,
ScopedVector<content::ResourceThrottle>* throttles) {
@@ -232,7 +232,7 @@ void AwResourceDispatcherHostDelegate::RequestBeginning(
// We allow intercepting only navigations within main frames. This
// is used to post onPageStarted. We handle shouldOverrideUrlLoading
// via a sync IPC.
- if (resource_type == ResourceType::MAIN_FRAME)
+ if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME)
throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor(
request));
}
@@ -321,7 +321,7 @@ void AwResourceDispatcherHostDelegate::OnResponseStarted(
return;
}
- if (request_info->GetResourceType() == ResourceType::MAIN_FRAME) {
+ if (request_info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME) {
// Check for x-auto-login header.
auto_login_parser::HeaderData header_data;
if (auto_login_parser::ParserHeaderInResponse(
@@ -403,8 +403,10 @@ void AwResourceDispatcherHostDelegate::AddExtraHeadersIfNeeded(
content::ResourceContext* resource_context) {
const content::ResourceRequestInfo* request_info =
content::ResourceRequestInfo::ForRequest(request);
- if (!request_info) return;
- if (request_info->GetResourceType() != ResourceType::MAIN_FRAME) return;
+ if (!request_info)
+ return;
+ if (request_info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME)
+ return;
const content::PageTransition transition = request_info->GetPageTransition();
const bool is_load_url =
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h
index 40a05e9..2723c4f 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h
@@ -33,7 +33,7 @@ class AwResourceDispatcherHostDelegate
net::URLRequest* request,
content::ResourceContext* resource_context,
content::AppCacheService* appcache_service,
- content::ResourceType::Type resource_type,
+ content::ResourceType resource_type,
int child_id,
int route_id,
ScopedVector<content::ResourceThrottle>* throttles) OVERRIDE;
diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc
index 12ffb15..8bdbf77 100644
--- a/android_webview/native/aw_contents_io_thread_client_impl.cc
+++ b/android_webview/native/aw_contents_io_thread_client_impl.cc
@@ -243,7 +243,7 @@ AwContentsIoThreadClientImpl::ShouldInterceptRequest(
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
bool is_main_frame = info &&
- info->GetResourceType() == ResourceType::MAIN_FRAME;
+ info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME;
bool has_user_gesture = info && info->HasUserGesture();
vector<string> headers_names;