blob: 1008e93d2537a09b8a20a7985781f8e35e3acf31 [file] [log] [blame]
[email protected]9045b8822012-01-13 20:35:351// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ac039522010-06-15 16:39:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/net/chrome_network_delegate.h"
6
avi6846aef2015-12-26 01:09:387#include <stddef.h>
[email protected]eac11e12013-03-19 22:04:328#include <stdlib.h>
9
[email protected]d1208ba32012-11-08 11:10:3310#include <vector>
11
[email protected]d8e4f132012-09-06 04:28:0512#include "base/base_paths.h"
mkwst0513c9d2015-04-01 05:53:1513#include "base/command_line.h"
jochenb93dba3c2014-11-11 05:28:4114#include "base/debug/alias.h"
jochenb5680e62014-10-13 08:43:4115#include "base/debug/dump_without_crashing.h"
jochenb93dba3c2014-11-11 05:28:4116#include "base/debug/stack_trace.h"
[email protected]7a299a92012-10-24 23:54:5017#include "base/logging.h"
avi6846aef2015-12-26 01:09:3818#include "base/macros.h"
jochen0e3b3a62014-09-16 18:31:2319#include "base/metrics/user_metrics.h"
[email protected]d8e4f132012-09-06 04:28:0520#include "base/path_service.h"
[email protected]3ea1b182013-02-08 22:38:4121#include "base/strings/string_number_conversions.h"
ellyjonesd84033d2015-02-12 19:20:3422#include "base/strings/string_util.h"
[email protected]069c49162013-09-11 20:46:3523#include "base/time/time.h"
avi6846aef2015-12-26 01:09:3824#include "build/build_config.h"
[email protected]6baff0b52012-03-06 01:30:1825#include "chrome/browser/browser_process.h"
drogerb1716972015-06-30 09:04:0926#include "chrome/browser/content_settings/cookie_settings_factory.h"
[email protected]9c8ae8c2012-03-09 13:13:3527#include "chrome/browser/content_settings/tab_specific_content_settings.h"
[email protected]8523ba52011-05-22 19:00:5828#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
[email protected]4a2b6232014-06-19 08:44:1429#include "chrome/browser/net/chrome_extensions_network_delegate.h"
[email protected]6baff0b52012-03-06 01:30:1830#include "chrome/browser/profiles/profile_manager.h"
avi24d693f2016-08-06 18:03:5231#include "chrome/browser/task_manager/task_manager_interface.h"
Scott Violet6200d332018-02-23 21:29:2332#include "chrome/common/buildflags.h"
[email protected]0a8db0d2011-04-13 15:15:4033#include "chrome/common/pref_names.h"
drogerb1716972015-06-30 09:04:0934#include "components/content_settings/core/browser/cookie_settings.h"
[email protected]45de676a2014-03-18 23:52:0235#include "components/domain_reliability/monitor.h"
Dominic Battre5e8a1cd2018-01-02 16:16:5836#include "components/variations/net/variations_http_headers.h"
[email protected]c38831a12011-10-28 12:44:4937#include "content/public/browser/browser_thread.h"
[email protected]9dfed872013-12-30 23:08:5638#include "content/public/browser/render_frame_host.h"
[email protected]9c1662b2012-03-06 15:44:3339#include "content/public/browser/render_view_host.h"
[email protected]9c8ae8c2012-03-09 13:13:3540#include "content/public/browser/resource_request_info.h"
mkwst0513c9d2015-04-01 05:53:1541#include "content/public/common/content_switches.h"
ellyjonesd84033d2015-02-12 19:20:3442#include "content/public/common/process_type.h"
tyoshino430d2f42016-12-15 09:30:0043#include "content/public/common/resource_type.h"
Scott Violetc8240b02018-03-08 22:03:5944#include "extensions/buildflags/buildflags.h"
[email protected]82b42302011-04-20 16:28:1645#include "net/base/host_port_pair.h"
[email protected]8202d0c2011-02-23 08:31:1446#include "net/base/net_errors.h"
[email protected]5b9bc352012-07-18 13:13:3447#include "net/cookies/canonical_cookie.h"
48#include "net/cookies/cookie_options.h"
[email protected]ac039522010-06-15 16:39:4449#include "net/http/http_request_headers.h"
[email protected]48944382011-04-23 13:28:1650#include "net/http/http_response_headers.h"
ellyjonesd84033d2015-02-12 19:20:3451#include "net/http/http_status_code.h"
eroman87c53d62015-04-02 06:51:0752#include "net/log/net_log.h"
mikecirone8b85c432016-09-08 19:11:0053#include "net/log/net_log_event_type.h"
mikecironef22f9812016-10-04 03:40:1954#include "net/log/net_log_with_source.h"
[email protected]d05ef99c2011-02-01 21:38:1655#include "net/url_request/url_request.h"
56
zpengdb4a58e2017-01-10 17:40:3257#if defined(OS_ANDROID)
Xing Liub9456c12018-05-11 01:46:1758#include "base/android/path_utils.h"
[email protected]4a2b6232014-06-19 08:44:1459#include "chrome/browser/io_thread.h"
[email protected]4a2b6232014-06-19 08:44:1460#endif
61
[email protected]4c219e22012-05-05 19:41:0462#if defined(OS_CHROMEOS)
[email protected]49c4cf852013-09-27 19:28:2463#include "base/sys_info.h"
[email protected]288538482012-09-06 21:09:3564#include "chrome/common/chrome_switches.h"
[email protected]4c219e22012-05-05 19:41:0465#endif
66
brettw00899e62016-11-12 02:10:1767#if BUILDFLAG(ENABLE_EXTENSIONS)
[email protected]84b7a552014-07-19 04:52:0668#include "extensions/common/constants.h"
69#endif
70
[email protected]631bb742011-11-02 11:29:3971using content::BrowserThread;
[email protected]eaabba22012-03-07 15:02:1172using content::RenderViewHost;
[email protected]ea114722012-03-12 01:11:2573using content::ResourceRequestInfo;
[email protected]631bb742011-11-02 11:29:3974
[email protected]d05ef99c2011-02-01 21:38:1675namespace {
76
satoruxd18e61a2017-06-08 06:38:4677bool g_access_to_all_files_enabled = false;
78
Ken Rockot314714c2017-11-05 23:36:2479bool IsAccessAllowedInternal(const base::FilePath& path,
80 const base::FilePath& profile_path) {
Chong Zhanga7f5b322018-09-20 00:05:2481 if (g_access_to_all_files_enabled)
82 return true;
83
Ken Rockot314714c2017-11-05 23:36:2484#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
85 return true;
86#else
87
88 std::vector<base::FilePath> whitelist;
89#if defined(OS_CHROMEOS)
90 // Use a whitelist to only allow access to files residing in the list of
91 // directories below.
92 static const base::FilePath::CharType* const kLocalAccessWhiteList[] = {
93 "/home/chronos/user/Downloads",
94 "/home/chronos/user/log",
95 "/home/chronos/user/WebRTC Logs",
96 "/media",
97 "/opt/oem",
Naoki Fukinoba401a52018-08-14 06:48:0198 "/run/arc/sdcard/write/emulated/0",
Ken Rockot314714c2017-11-05 23:36:2499 "/usr/share/chromeos-assets",
100 "/var/log",
101 };
102
103 base::FilePath temp_dir;
Avi Drissmanea15ea02018-05-07 18:55:12104 if (base::PathService::Get(base::DIR_TEMP, &temp_dir))
Ken Rockot314714c2017-11-05 23:36:24105 whitelist.push_back(temp_dir);
106
107 // The actual location of "/home/chronos/user/Xyz" is the Xyz directory under
108 // the profile path ("/home/chronos/user' is a hard link to current primary
109 // logged in profile.) For the support of multi-profile sessions, we are
110 // switching to use explicit "$PROFILE_PATH/Xyz" path and here whitelist such
111 // access.
112 if (!profile_path.empty()) {
113 const base::FilePath downloads = profile_path.AppendASCII("Downloads");
114 whitelist.push_back(downloads);
115 const base::FilePath webrtc_logs = profile_path.AppendASCII("WebRTC Logs");
116 whitelist.push_back(webrtc_logs);
117 }
118#elif defined(OS_ANDROID)
119 // Access to files in external storage is allowed.
120 base::FilePath external_storage_path;
Avi Drissman9098f9002018-05-04 00:11:52121 base::PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE,
122 &external_storage_path);
Ken Rockot314714c2017-11-05 23:36:24123 if (external_storage_path.IsParent(path))
124 return true;
125
Xing Liub9456c12018-05-11 01:46:17126 auto all_download_dirs = base::android::GetAllPrivateDownloadsDirectories();
127 for (const auto& dir : all_download_dirs)
128 whitelist.push_back(dir);
129
Ken Rockot314714c2017-11-05 23:36:24130 // Whitelist of other allowed directories.
131 static const base::FilePath::CharType* const kLocalAccessWhiteList[] = {
132 "/sdcard", "/mnt/sdcard",
133 };
134#endif
135
136 for (const auto* whitelisted_path : kLocalAccessWhiteList)
137 whitelist.push_back(base::FilePath(whitelisted_path));
138
139 for (const auto& whitelisted_path : whitelist) {
140 // base::FilePath::operator== should probably handle trailing separators.
141 if (whitelisted_path == path.StripTrailingSeparators() ||
142 whitelisted_path.IsParent(path)) {
143 return true;
144 }
145 }
146
147 DVLOG(1) << "File access denied - " << path.value().c_str();
148 return false;
149#endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
150}
151
[email protected]d05ef99c2011-02-01 21:38:16152} // namespace
[email protected]ac039522010-06-15 16:39:44153
[email protected]0651b812011-02-24 00:22:50154ChromeNetworkDelegate::ChromeNetworkDelegate(
Matt Menkeb63ff0d92018-06-18 21:40:16155 extensions::EventRouterForwarder* event_router)
Chris Mumfordeee253372018-05-29 21:12:38156 : extensions_delegate_(
157 ChromeExtensionsNetworkDelegate::Create(event_router)),
158 profile_(nullptr),
mkwst0513c9d2015-04-01 05:53:15159 experimental_web_platform_features_enabled_(
gayane0b46091c2016-04-07 21:01:05160 base::CommandLine::ForCurrentProcess()->HasSwitch(
rajendrant39806352018-07-19 23:23:35161 switches::kEnableExperimentalWebPlatformFeatures)) {}
[email protected]0651b812011-02-24 00:22:50162
[email protected]ac039522010-06-15 16:39:44163ChromeNetworkDelegate::~ChromeNetworkDelegate() {}
164
[email protected]a09159a2012-11-29 12:51:48165void ChromeNetworkDelegate::set_extension_info_map(
[email protected]38427a12013-11-09 17:34:20166 extensions::InfoMap* extension_info_map) {
[email protected]4a2b6232014-06-19 08:44:14167 extensions_delegate_->set_extension_info_map(extension_info_map);
168}
169
170void ChromeNetworkDelegate::set_profile(void* profile) {
171 profile_ = profile;
172 extensions_delegate_->set_profile(profile);
[email protected]a09159a2012-11-29 12:51:48173}
174
175void ChromeNetworkDelegate::set_cookie_settings(
drogerb1716972015-06-30 09:04:09176 content_settings::CookieSettings* cookie_settings) {
[email protected]a09159a2012-11-29 12:51:48177 cookie_settings_ = cookie_settings;
178}
179
[email protected]4875ba12011-03-30 22:31:51180int ChromeNetworkDelegate::OnBeforeURLRequest(
[email protected]4c76d7c2011-04-15 19:14:12181 net::URLRequest* request,
David Benjamind1f287bf2018-06-12 01:57:20182 net::CompletionOnceCallback callback,
[email protected]4c76d7c2011-04-15 19:14:12183 GURL* new_url) {
[email protected]4a2b6232014-06-19 08:44:14184 extensions_delegate_->ForwardStartRequestStatus(request);
John Abd-El-Malek9fb60492018-08-02 04:28:50185 return extensions_delegate_->NotifyBeforeURLRequest(
186 request, std::move(callback), new_url);
[email protected]d05ef99c2011-02-01 21:38:16187}
188
ryansturm2343cb62016-06-15 01:09:00189int ChromeNetworkDelegate::OnBeforeStartTransaction(
[email protected]636eccd2011-06-28 12:28:01190 net::URLRequest* request,
David Benjamind1f287bf2018-06-12 01:57:20191 net::CompletionOnceCallback callback,
[email protected]4c76d7c2011-04-15 19:14:12192 net::HttpRequestHeaders* headers) {
David Benjamind1f287bf2018-06-12 01:57:20193 return extensions_delegate_->NotifyBeforeStartTransaction(
194 request, std::move(callback), headers);
[email protected]ac039522010-06-15 16:39:44195}
[email protected]8202d0c2011-02-23 08:31:14196
ryansturm2343cb62016-06-15 01:09:00197void ChromeNetworkDelegate::OnStartTransaction(
[email protected]5796dc942011-07-14 19:26:10198 net::URLRequest* request,
[email protected]783573b2011-05-13 11:05:15199 const net::HttpRequestHeaders& headers) {
David Benjamind1f287bf2018-06-12 01:57:20200 extensions_delegate_->NotifyStartTransaction(request, headers);
[email protected]82b42302011-04-20 16:28:16201}
202
[email protected]ea8141e2011-10-05 13:12:51203int ChromeNetworkDelegate::OnHeadersReceived(
204 net::URLRequest* request,
David Benjamind1f287bf2018-06-12 01:57:20205 net::CompletionOnceCallback callback,
[email protected]507af8f2012-10-20 00:42:32206 const net::HttpResponseHeaders* original_response_headers,
[email protected]5f714132014-03-26 10:41:16207 scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
208 GURL* allowed_unsafe_redirect_url) {
David Benjamind1f287bf2018-06-12 01:57:20209 return extensions_delegate_->NotifyHeadersReceived(
210 request, std::move(callback), original_response_headers,
211 override_response_headers, allowed_unsafe_redirect_url);
[email protected]ea8141e2011-10-05 13:12:51212}
213
[email protected]31b2e5f2011-04-20 16:58:32214void ChromeNetworkDelegate::OnBeforeRedirect(net::URLRequest* request,
215 const GURL& new_location) {
[email protected]45de676a2014-03-18 23:52:02216 if (domain_reliability_monitor_)
217 domain_reliability_monitor_->OnBeforeRedirect(request);
David Benjamind1f287bf2018-06-12 01:57:20218 extensions_delegate_->NotifyBeforeRedirect(request, new_location);
Dominic Battre5e8a1cd2018-01-02 16:16:58219 variations::StripVariationHeaderIfNeeded(new_location, request);
[email protected]31b2e5f2011-04-20 16:58:32220}
221
maksim.sisov1b83bb72016-10-07 06:07:23222void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request,
223 int net_error) {
David Benjamind1f287bf2018-06-12 01:57:20224 extensions_delegate_->NotifyResponseStarted(request, net_error);
[email protected]8202d0c2011-02-23 08:31:14225}
226
sclittlea133de02015-11-10 23:54:21227void ChromeNetworkDelegate::OnNetworkBytesReceived(net::URLRequest* request,
228 int64_t bytes_received) {
brettwee486bb2016-12-08 17:56:34229#if !defined(OS_ANDROID)
sclittlece72c482015-08-24 20:20:59230 // Note: Currently, OnNetworkBytesReceived is only implemented for HTTP jobs,
231 // not FTP or other types, so those kinds of bytes will not be reported here.
avi24d693f2016-08-06 18:03:52232 task_manager::TaskManagerInterface::OnRawBytesRead(*request, bytes_received);
brettwee486bb2016-12-08 17:56:34233#endif // !defined(OS_ANDROID)
sclittleae932be2015-10-08 20:53:50234}
235
sclittlea133de02015-11-10 23:54:21236void ChromeNetworkDelegate::OnNetworkBytesSent(net::URLRequest* request,
sclittleae932be2015-10-08 20:53:50237 int64_t bytes_sent) {
cburne9d2f3612017-06-20 22:15:03238#if !defined(OS_ANDROID)
239 // Note: Currently, OnNetworkBytesSent is only implemented for HTTP jobs,
240 // not FTP or other types, so those kinds of bytes will not be reported here.
241 task_manager::TaskManagerInterface::OnRawBytesSent(*request, bytes_sent);
242#endif // !defined(OS_ANDROID)
[email protected]8523ba52011-05-22 19:00:58243}
244
[email protected]9045b8822012-01-13 20:35:35245void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request,
maksim.sisov1b83bb72016-10-07 06:07:23246 bool started,
247 int net_error) {
David Benjamind1f287bf2018-06-12 01:57:20248 extensions_delegate_->NotifyCompleted(request, started, net_error);
[email protected]45de676a2014-03-18 23:52:02249 if (domain_reliability_monitor_)
250 domain_reliability_monitor_->OnCompleted(request, started);
[email protected]4a2b6232014-06-19 08:44:14251 extensions_delegate_->ForwardDoneRequestStatus(request);
[email protected]8202d0c2011-02-23 08:31:14252}
[email protected]4b50cb52011-03-10 00:29:37253
[email protected]4875ba12011-03-30 22:31:51254void ChromeNetworkDelegate::OnURLRequestDestroyed(net::URLRequest* request) {
David Benjamind1f287bf2018-06-12 01:57:20255 extensions_delegate_->NotifyURLRequestDestroyed(request);
[email protected]4875ba12011-03-30 22:31:51256}
257
[email protected]c2911d72011-10-03 22:16:36258net::NetworkDelegate::AuthRequiredResponse
David Benjamind1f287bf2018-06-12 01:57:20259ChromeNetworkDelegate::OnAuthRequired(net::URLRequest* request,
260 const net::AuthChallengeInfo& auth_info,
261 AuthCallback callback,
262 net::AuthCredentials* credentials) {
263 return extensions_delegate_->NotifyAuthRequired(
264 request, auth_info, std::move(callback), credentials);
[email protected]7efc582d2011-08-03 20:46:35265}
[email protected]9c8ae8c2012-03-09 13:13:35266
Clark DuValle8737642018-08-31 17:26:34267bool ChromeNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
268 const net::CookieList& cookie_list,
269 bool allowed_from_caller) {
jam092d3be2016-09-27 15:56:36270 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
271 if (info) {
[email protected]9c8ae8c2012-03-09 13:13:35272 BrowserThread::PostTask(
273 BrowserThread::UI, FROM_HERE,
tzik53a7b9022017-04-24 11:14:48274 base::BindOnce(&TabSpecificContentSettings::CookiesRead,
275 info->GetWebContentsGetterForRequest(), request.url(),
Clark DuValle8737642018-08-31 17:26:34276 request.site_for_cookies(), cookie_list,
277 !allowed_from_caller));
[email protected]9c8ae8c2012-03-09 13:13:35278 }
Clark DuValle8737642018-08-31 17:26:34279 return allowed_from_caller;
[email protected]9c8ae8c2012-03-09 13:13:35280}
281
[email protected]4c219e22012-05-05 19:41:04282bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
Victor Costan70f85512017-11-20 16:14:46283 const net::CanonicalCookie& cookie,
Clark DuValle8737642018-08-31 17:26:34284 net::CookieOptions* options,
285 bool allowed_from_caller) {
jam092d3be2016-09-27 15:56:36286 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
287 if (info) {
[email protected]9c8ae8c2012-03-09 13:13:35288 BrowserThread::PostTask(
289 BrowserThread::UI, FROM_HERE,
tzik53a7b9022017-04-24 11:14:48290 base::BindOnce(&TabSpecificContentSettings::CookieChanged,
291 info->GetWebContentsGetterForRequest(), request.url(),
Clark DuValle8737642018-08-31 17:26:34292 request.site_for_cookies(), cookie,
293 !allowed_from_caller));
[email protected]9c8ae8c2012-03-09 13:13:35294 }
Clark DuValle8737642018-08-31 17:26:34295 return allowed_from_caller;
[email protected]9c8ae8c2012-03-09 13:13:35296}
[email protected]4c219e22012-05-05 19:41:04297
satoruxddac0442017-05-29 06:06:18298bool ChromeNetworkDelegate::OnCanAccessFile(
299 const net::URLRequest& request,
300 const base::FilePath& original_path,
301 const base::FilePath& absolute_path) const {
Ken Rockot314714c2017-11-05 23:36:24302 return IsAccessAllowed(original_path, absolute_path, profile_path_);
satorux7c5360582017-01-27 07:24:29303}
304
305// static
306bool ChromeNetworkDelegate::IsAccessAllowed(
307 const base::FilePath& path,
308 const base::FilePath& profile_path) {
Ken Rockot314714c2017-11-05 23:36:24309 return IsAccessAllowedInternal(path, profile_path);
310}
311
312// static
313bool ChromeNetworkDelegate::IsAccessAllowed(
314 const base::FilePath& path,
315 const base::FilePath& absolute_path,
316 const base::FilePath& profile_path) {
317#if defined(OS_ANDROID)
318 // Android's whitelist relies on symbolic links (ex. /sdcard is whitelisted
319 // and commonly a symbolic link), thus do not check absolute paths.
320 return IsAccessAllowedInternal(path, profile_path);
satorux7c5360582017-01-27 07:24:29321#else
Ken Rockot314714c2017-11-05 23:36:24322 return (IsAccessAllowedInternal(path, profile_path) &&
323 IsAccessAllowedInternal(absolute_path, profile_path));
[email protected]d8e4f132012-09-06 04:28:05324#endif
[email protected]4c219e22012-05-05 19:41:04325}
[email protected]a1d4ab072012-06-07 13:21:15326
satoruxd18e61a2017-06-08 06:38:46327// static
328void ChromeNetworkDelegate::EnableAccessToAllFilesForTesting(bool enabled) {
329 g_access_to_all_files_enabled = enabled;
330}
331
estark7625d812015-10-12 20:10:41332bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
mkwst0513c9d2015-04-01 05:53:15333 return experimental_web_platform_features_enabled_;
334}
335
jochen0e3b3a62014-09-16 18:31:23336bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
337 const net::URLRequest& request,
338 const GURL& target_url,
339 const GURL& referrer_url) const {
Matt Menke10e6cade2018-06-20 12:54:20340 // These errors should be handled by the NetworkDelegate wrapper created by
341 // the owning NetworkContext.
342 NOTREACHED();
jochen0e3b3a62014-09-16 18:31:23343 return true;
344}
sclittlea133de02015-11-10 23:54:21345
juliatuttlefcf47202017-05-23 15:53:02346bool ChromeNetworkDelegate::OnCanQueueReportingReport(
347 const url::Origin& origin) const {
348 if (!cookie_settings_)
Douglas Creager81cad472018-05-17 14:34:09349 return false;
juliatuttlefcf47202017-05-23 15:53:02350
351 return cookie_settings_->IsCookieAccessAllowed(origin.GetURL(),
352 origin.GetURL());
353}
354
Douglas Creager7b07ea42018-02-27 21:08:08355void ChromeNetworkDelegate::OnCanSendReportingReports(
356 std::set<url::Origin> origins,
357 base::OnceCallback<void(std::set<url::Origin>)> result_callback) const {
Douglas Creager81cad472018-05-17 14:34:09358 if (!reporting_permissions_checker_) {
359 origins.clear();
Douglas Creager7b07ea42018-02-27 21:08:08360 std::move(result_callback).Run(std::move(origins));
361 return;
362 }
juliatuttlefcf47202017-05-23 15:53:02363
Douglas Creager81cad472018-05-17 14:34:09364 reporting_permissions_checker_->FilterReportingOrigins(
365 std::move(origins), std::move(result_callback));
juliatuttlefcf47202017-05-23 15:53:02366}
367
368bool ChromeNetworkDelegate::OnCanSetReportingClient(
369 const url::Origin& origin,
370 const GURL& endpoint) const {
371 if (!cookie_settings_)
Douglas Creager81cad472018-05-17 14:34:09372 return false;
juliatuttlefcf47202017-05-23 15:53:02373
374 return cookie_settings_->IsCookieAccessAllowed(endpoint, origin.GetURL());
375}
376
377bool ChromeNetworkDelegate::OnCanUseReportingClient(
378 const url::Origin& origin,
379 const GURL& endpoint) const {
380 if (!cookie_settings_)
Douglas Creager81cad472018-05-17 14:34:09381 return false;
juliatuttlefcf47202017-05-23 15:53:02382
383 return cookie_settings_->IsCookieAccessAllowed(endpoint, origin.GetURL());
384}