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

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

Issue 516663002: Introducing the OffDomainInclusionDetector to analyze resource requests for suspicious activity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Base analysis off of second-level domain only. Created 6 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 "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"
11 #include "base/guid.h" 11 #include "base/guid.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/component_updater/component_updater_resource_throttle.h " 15 #include "chrome/browser/component_updater/component_updater_resource_throttle.h "
16 #include "chrome/browser/content_settings/host_content_settings_map.h" 16 #include "chrome/browser/content_settings/host_content_settings_map.h"
17 #include "chrome/browser/download/download_request_limiter.h" 17 #include "chrome/browser/download/download_request_limiter.h"
18 #include "chrome/browser/download/download_resource_throttle.h" 18 #include "chrome/browser/download/download_resource_throttle.h"
19 #include "chrome/browser/prefetch/prefetch.h" 19 #include "chrome/browser/prefetch/prefetch.h"
20 #include "chrome/browser/prerender/prerender_manager.h" 20 #include "chrome/browser/prerender/prerender_manager.h"
21 #include "chrome/browser/prerender/prerender_manager_factory.h" 21 #include "chrome/browser/prerender/prerender_manager_factory.h"
22 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h" 22 #include "chrome/browser/prerender/prerender_pending_swap_throttle.h"
23 #include "chrome/browser/prerender/prerender_resource_throttle.h" 23 #include "chrome/browser/prerender/prerender_resource_throttle.h"
24 #include "chrome/browser/prerender/prerender_tracker.h" 24 #include "chrome/browser/prerender/prerender_tracker.h"
25 #include "chrome/browser/prerender/prerender_util.h" 25 #include "chrome/browser/prerender/prerender_util.h"
26 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/profiles/profile_io_data.h" 27 #include "chrome/browser/profiles/profile_io_data.h"
28 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h " 28 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h "
29 #include "chrome/browser/safe_browsing/client_side_detection_service.h"
mattm 2014/09/09 21:20:16 unused
gab 2014/11/12 20:49:34 Done.
29 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 30 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
30 #include "chrome/browser/signin/signin_header_helper.h" 31 #include "chrome/browser/signin/signin_header_helper.h"
31 #include "chrome/browser/tab_contents/tab_util.h" 32 #include "chrome/browser/tab_contents/tab_util.h"
32 #include "chrome/browser/ui/login/login_prompt.h" 33 #include "chrome/browser/ui/login/login_prompt.h"
33 #include "chrome/browser/ui/sync/one_click_signin_helper.h" 34 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
34 #include "chrome/common/extensions/extension_constants.h" 35 #include "chrome/common/extensions/extension_constants.h"
35 #include "chrome/common/render_messages.h" 36 #include "chrome/common/render_messages.h"
36 #include "chrome/common/url_constants.h" 37 #include "chrome/common/url_constants.h"
37 #include "components/google/core/browser/google_util.h" 38 #include "components/google/core/browser/google_util.h"
38 #include "components/variations/variations_http_header_provider.h" 39 #include "components/variations/variations_http_header_provider.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 297
297 return true; 298 return true;
298 } 299 }
299 300
300 void ChromeResourceDispatcherHostDelegate::RequestBeginning( 301 void ChromeResourceDispatcherHostDelegate::RequestBeginning(
301 net::URLRequest* request, 302 net::URLRequest* request,
302 content::ResourceContext* resource_context, 303 content::ResourceContext* resource_context,
303 content::AppCacheService* appcache_service, 304 content::AppCacheService* appcache_service,
304 ResourceType resource_type, 305 ResourceType resource_type,
305 ScopedVector<content::ResourceThrottle>* throttles) { 306 ScopedVector<content::ResourceThrottle>* throttles) {
307 if (safe_browsing_)
308 safe_browsing_->OnResourceRequest(request, resource_type);
309
306 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 310 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
307 bool is_prerendering = 311 bool is_prerendering =
308 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender; 312 info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender;
309 if (is_prerendering) { 313 if (is_prerendering) {
310 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs) 314 // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs)
311 // should remain at MAXIMUM_PRIORITY. 315 // should remain at MAXIMUM_PRIORITY.
312 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) { 316 if (request->load_flags() & net::LOAD_IGNORE_LIMITS) {
313 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); 317 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY);
314 } else { 318 } else {
315 request->SetPriority(net::IDLE); 319 request->SetPriority(net::IDLE);
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 url_request->GetTotalReceivedBytes())); 739 url_request->GetTotalReceivedBytes()));
736 } 740 }
737 } 741 }
738 742
739 // static 743 // static
740 void ChromeResourceDispatcherHostDelegate:: 744 void ChromeResourceDispatcherHostDelegate::
741 SetExternalProtocolHandlerDelegateForTesting( 745 SetExternalProtocolHandlerDelegateForTesting(
742 ExternalProtocolHandler::Delegate* delegate) { 746 ExternalProtocolHandler::Delegate* delegate) {
743 g_external_protocol_handler_delegate = delegate; 747 g_external_protocol_handler_delegate = delegate;
744 } 748 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698