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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 615433002: Add a resource throttle for sub frame unless scheme of uri is acceptable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 6 years, 2 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 "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #endif 78 #endif
79 79
80 #if defined(USE_SYSTEM_PROTOBUF) 80 #if defined(USE_SYSTEM_PROTOBUF)
81 #include <google/protobuf/repeated_field.h> 81 #include <google/protobuf/repeated_field.h>
82 #else 82 #else
83 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" 83 #include "third_party/protobuf/src/google/protobuf/repeated_field.h"
84 #endif 84 #endif
85 85
86 #if defined(OS_ANDROID) 86 #if defined(OS_ANDROID)
87 #include "chrome/browser/android/intercept_download_resource_throttle.h" 87 #include "chrome/browser/android/intercept_download_resource_throttle.h"
88 #include "chrome/browser/android/url_utilities.h"
88 #include "chrome/browser/ui/android/infobars/auto_login_prompter.h" 89 #include "chrome/browser/ui/android/infobars/auto_login_prompter.h"
89 #include "components/navigation_interception/intercept_navigation_delegate.h" 90 #include "components/navigation_interception/intercept_navigation_delegate.h"
90 #endif 91 #endif
91 92
92 #if defined(OS_CHROMEOS) 93 #if defined(OS_CHROMEOS)
93 #include "chrome/browser/chromeos/login/signin/merge_session_throttle.h" 94 #include "chrome/browser/chromeos/login/signin/merge_session_throttle.h"
94 // TODO(oshima): Enable this for other platforms. 95 // TODO(oshima): Enable this for other platforms.
95 #include "chrome/browser/renderer_host/offline_resource_throttle.h" 96 #include "chrome/browser/renderer_host/offline_resource_throttle.h"
96 #endif 97 #endif
97 98
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 request->SetPriority(net::IDLE); 317 request->SetPriority(net::IDLE);
317 } 318 }
318 } 319 }
319 320
320 ProfileIOData* io_data = ProfileIOData::FromResourceContext( 321 ProfileIOData* io_data = ProfileIOData::FromResourceContext(
321 resource_context); 322 resource_context);
322 323
323 #if defined(OS_ANDROID) 324 #if defined(OS_ANDROID)
324 // TODO(davidben): This is insufficient to integrate with prerender properly. 325 // TODO(davidben): This is insufficient to integrate with prerender properly.
325 // https://crbug.com/370595 326 // https://crbug.com/370595
326 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME && !is_prerendering) { 327 if (!is_prerendering && (resource_type == content::RESOURCE_TYPE_MAIN_FRAME ||
328 (resource_type == content::RESOURCE_TYPE_SUB_FRAME &&
329 !IsAcceptedScheme(request->url().spec())))) {
davidben 2014/09/29 21:40:44 Could you add a comment explaining why it's import
Jaekyun Seok (inactive) 2014/09/29 22:17:18 Yes, I will.
327 throttles->push_back( 330 throttles->push_back(
328 InterceptNavigationDelegate::CreateThrottleFor(request)); 331 InterceptNavigationDelegate::CreateThrottleFor(request));
329 } 332 }
330 #else 333 #else
331 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) { 334 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
332 // Redirect some navigations to apps that have registered matching URL 335 // Redirect some navigations to apps that have registered matching URL
333 // handlers ('url_handlers' in the manifest). 336 // handlers ('url_handlers' in the manifest).
334 content::ResourceThrottle* url_to_app_throttle = 337 content::ResourceThrottle* url_to_app_throttle =
335 AppUrlRedirector::MaybeCreateThrottleFor(request, io_data); 338 AppUrlRedirector::MaybeCreateThrottleFor(request, io_data);
336 if (url_to_app_throttle) 339 if (url_to_app_throttle)
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 url_request->GetTotalReceivedBytes())); 752 url_request->GetTotalReceivedBytes()));
750 } 753 }
751 } 754 }
752 755
753 // static 756 // static
754 void ChromeResourceDispatcherHostDelegate:: 757 void ChromeResourceDispatcherHostDelegate::
755 SetExternalProtocolHandlerDelegateForTesting( 758 SetExternalProtocolHandlerDelegateForTesting(
756 ExternalProtocolHandler::Delegate* delegate) { 759 ExternalProtocolHandler::Delegate* delegate) {
757 g_external_protocol_handler_delegate = delegate; 760 g_external_protocol_handler_delegate = delegate;
758 } 761 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698