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

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

Issue 2238383002: Add SafeBrowsingNavigationThrottle Base URL: https://chromium.googlesource.com/chromium/src.git@unsafe-resource-to-webcontents
Patch Set: . Created 4 years, 4 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 <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "content/public/browser/plugin_service.h" 57 #include "content/public/browser/plugin_service.h"
58 #include "content/public/browser/plugin_service_filter.h" 58 #include "content/public/browser/plugin_service_filter.h"
59 #include "content/public/browser/render_process_host.h" 59 #include "content/public/browser/render_process_host.h"
60 #include "content/public/browser/render_view_host.h" 60 #include "content/public/browser/render_view_host.h"
61 #include "content/public/browser/resource_context.h" 61 #include "content/public/browser/resource_context.h"
62 #include "content/public/browser/resource_dispatcher_host.h" 62 #include "content/public/browser/resource_dispatcher_host.h"
63 #include "content/public/browser/resource_request_info.h" 63 #include "content/public/browser/resource_request_info.h"
64 #include "content/public/browser/service_worker_context.h" 64 #include "content/public/browser/service_worker_context.h"
65 #include "content/public/browser/stream_info.h" 65 #include "content/public/browser/stream_info.h"
66 #include "content/public/browser/web_contents.h" 66 #include "content/public/browser/web_contents.h"
67 #include "content/public/common/browser_side_navigation_policy.h"
67 #include "content/public/common/resource_response.h" 68 #include "content/public/common/resource_response.h"
69 #include "content/public/common/resource_type.h"
68 #include "net/base/load_flags.h" 70 #include "net/base/load_flags.h"
69 #include "net/base/load_timing_info.h" 71 #include "net/base/load_timing_info.h"
70 #include "net/base/request_priority.h" 72 #include "net/base/request_priority.h"
71 #include "net/http/http_response_headers.h" 73 #include "net/http/http_response_headers.h"
72 #include "net/ssl/client_cert_store.h" 74 #include "net/ssl/client_cert_store.h"
73 #include "net/url_request/url_request.h" 75 #include "net/url_request/url_request.h"
74 76
75 #if !defined(DISABLE_NACL) 77 #if !defined(DISABLE_NACL)
76 #include "chrome/browser/component_updater/pnacl_component_installer.h" 78 #include "chrome/browser/component_updater/pnacl_component_installer.h"
77 #endif 79 #endif
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 601
600 // Insert either safe browsing or data reduction proxy throttle at the front 602 // Insert either safe browsing or data reduction proxy throttle at the front
601 // of the list, so one of them gets to decide if the resource is safe. 603 // of the list, so one of them gets to decide if the resource is safe.
602 content::ResourceThrottle* first_throttle = NULL; 604 content::ResourceThrottle* first_throttle = NULL;
603 #if defined(OS_ANDROID) 605 #if defined(OS_ANDROID)
604 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate( 606 first_throttle = DataReductionProxyResourceThrottle::MaybeCreate(
605 request, resource_context, resource_type, safe_browsing_.get()); 607 request, resource_context, resource_type, safe_browsing_.get());
606 #endif // defined(OS_ANDROID) 608 #endif // defined(OS_ANDROID)
607 609
608 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) 610 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
609 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) { 611 if (!first_throttle && io_data->safe_browsing_enabled()->GetValue() &&
612 (!content::IsBrowserSideNavigationEnabled() ||
613 !content::IsResourceTypeFrame(resource_type))) {
610 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate( 614 first_throttle = SafeBrowsingResourceThrottle::MaybeCreate(
611 request, resource_type, safe_browsing_.get()); 615 request, resource_type, safe_browsing_.get());
612 } 616 }
613 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) 617 #endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
614 618
615 if (first_throttle) 619 if (first_throttle)
616 throttles->push_back(first_throttle); 620 throttles->push_back(first_throttle);
617 621
618 #if defined(ENABLE_SUPERVISED_USERS) 622 #if defined(ENABLE_SUPERVISED_USERS)
619 bool is_subresource_request = 623 bool is_subresource_request =
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); 874 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
871 return data; 875 return data;
872 } 876 }
873 877
874 std::unique_ptr<net::ClientCertStore> 878 std::unique_ptr<net::ClientCertStore>
875 ChromeResourceDispatcherHostDelegate::CreateClientCertStore( 879 ChromeResourceDispatcherHostDelegate::CreateClientCertStore(
876 content::ResourceContext* resource_context) { 880 content::ResourceContext* resource_context) {
877 return ProfileIOData::FromResourceContext(resource_context)-> 881 return ProfileIOData::FromResourceContext(resource_context)->
878 CreateClientCertStore(); 882 CreateClientCertStore();
879 } 883 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/renderer_host/safe_browsing_navigation_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698