Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc

Issue 1350913008: Revert of Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "android_webview/browser/aw_contents_io_thread_client.h" 9 #include "android_webview/browser/aw_contents_io_thread_client.h"
10 #include "android_webview/browser/aw_login_delegate.h" 10 #include "android_webview/browser/aw_login_delegate.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 content::ResourceRequestInfo::ForRequest(request); 214 content::ResourceRequestInfo::ForRequest(request);
215 215
216 // We always push the throttles here. Checking the existence of io_client 216 // We always push the throttles here. Checking the existence of io_client
217 // is racy when a popup window is created. That is because RequestBeginning 217 // is racy when a popup window is created. That is because RequestBeginning
218 // is called whether or not requests are blocked via BlockRequestForRoute() 218 // is called whether or not requests are blocked via BlockRequestForRoute()
219 // however io_client may or may not be ready at the time depending on whether 219 // however io_client may or may not be ready at the time depending on whether
220 // webcontents is created. 220 // webcontents is created.
221 throttles->push_back(new IoThreadClientThrottle( 221 throttles->push_back(new IoThreadClientThrottle(
222 request_info->GetChildID(), request_info->GetRenderFrameID(), request)); 222 request_info->GetChildID(), request_info->GetRenderFrameID(), request));
223 223
224 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME ||
225 (resource_type == content::RESOURCE_TYPE_SUB_FRAME &&
226 !request->url().SchemeIs(url::kHttpScheme) &&
227 !request->url().SchemeIs(url::kHttpsScheme) &&
228 !request->url().SchemeIs(url::kAboutScheme))) {
229 throttles->push_back(InterceptNavigationDelegate::CreateThrottleFor(
230 request));
231 }
224 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) 232 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME)
225 InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request); 233 InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request);
226 } 234 }
227 235
228 void AwResourceDispatcherHostDelegate::OnRequestRedirected( 236 void AwResourceDispatcherHostDelegate::OnRequestRedirected(
229 const GURL& redirect_url, 237 const GURL& redirect_url,
230 net::URLRequest* request, 238 net::URLRequest* request,
231 content::ResourceContext* resource_context, 239 content::ResourceContext* resource_context,
232 content::ResourceResponse* response) { 240 content::ResourceResponse* response) {
233 AddExtraHeadersIfNeeded(request, resource_context); 241 AddExtraHeadersIfNeeded(request, resource_context);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 net::HttpRequestHeaders headers; 439 net::HttpRequestHeaders headers;
432 headers.AddHeadersFromString(extra_headers); 440 headers.AddHeadersFromString(extra_headers);
433 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { 441 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) {
434 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); 442 request->SetExtraRequestHeaderByName(it.name(), it.value(), false);
435 } 443 }
436 } 444 }
437 } 445 }
438 } 446 }
439 447
440 } // namespace android_webview 448 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.cc ('k') | chrome/browser/apps/app_url_redirector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698