| OLD | NEW |
| 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/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "content/public/common/process_type.h" | 52 #include "content/public/common/process_type.h" |
| 53 #include "net/base/host_port_pair.h" | 53 #include "net/base/host_port_pair.h" |
| 54 #include "net/base/load_flags.h" | 54 #include "net/base/load_flags.h" |
| 55 #include "net/base/net_errors.h" | 55 #include "net/base/net_errors.h" |
| 56 #include "net/cookies/canonical_cookie.h" | 56 #include "net/cookies/canonical_cookie.h" |
| 57 #include "net/cookies/cookie_options.h" | 57 #include "net/cookies/cookie_options.h" |
| 58 #include "net/http/http_request_headers.h" | 58 #include "net/http/http_request_headers.h" |
| 59 #include "net/http/http_response_headers.h" | 59 #include "net/http/http_response_headers.h" |
| 60 #include "net/http/http_status_code.h" | 60 #include "net/http/http_status_code.h" |
| 61 #include "net/log/net_log.h" | 61 #include "net/log/net_log.h" |
| 62 #include "net/log/net_log_event_type.h" |
| 62 #include "net/url_request/url_request.h" | 63 #include "net/url_request/url_request.h" |
| 63 | 64 |
| 64 #if BUILDFLAG(ANDROID_JAVA_UI) | 65 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 65 #include "chrome/browser/io_thread.h" | 66 #include "chrome/browser/io_thread.h" |
| 66 #include "chrome/browser/precache/precache_util.h" | 67 #include "chrome/browser/precache/precache_util.h" |
| 67 #endif | 68 #endif |
| 68 | 69 |
| 69 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
| 70 #include "base/sys_info.h" | 71 #include "base/sys_info.h" |
| 71 #include "chrome/common/chrome_switches.h" | 72 #include "chrome/common/chrome_switches.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // which is not blocked. | 243 // which is not blocked. |
| 243 | 244 |
| 244 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 245 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 245 int error = net::ERR_BLOCKED_BY_ADMINISTRATOR; | 246 int error = net::ERR_BLOCKED_BY_ADMINISTRATOR; |
| 246 if (info && content::IsResourceTypeFrame(info->GetResourceType()) && | 247 if (info && content::IsResourceTypeFrame(info->GetResourceType()) && |
| 247 url_blacklist_manager_ && | 248 url_blacklist_manager_ && |
| 248 url_blacklist_manager_->ShouldBlockRequestForFrame( | 249 url_blacklist_manager_->ShouldBlockRequestForFrame( |
| 249 request->url(), &error)) { | 250 request->url(), &error)) { |
| 250 // URL access blocked by policy. | 251 // URL access blocked by policy. |
| 251 request->net_log().AddEvent( | 252 request->net_log().AddEvent( |
| 252 net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST, | 253 net::NetLogEventType::CHROME_POLICY_ABORTED_REQUEST, |
| 253 net::NetLog::StringCallback("url", | 254 net::NetLog::StringCallback("url", |
| 254 &request->url().possibly_invalid_spec())); | 255 &request->url().possibly_invalid_spec())); |
| 255 return error; | 256 return error; |
| 256 } | 257 } |
| 257 | 258 |
| 258 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. | 259 // TODO(mmenke): Remove ScopedTracker below once crbug.com/456327 is fixed. |
| 259 tracked_objects::ScopedTracker tracking_profile2( | 260 tracked_objects::ScopedTracker tracking_profile2( |
| 260 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 261 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 261 "456327 URLRequest::ChromeNetworkDelegate::OnBeforeURLRequest 2")); | 262 "456327 URLRequest::ChromeNetworkDelegate::OnBeforeURLRequest 2")); |
| 262 | 263 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 if (!data_use_aggregator_) | 585 if (!data_use_aggregator_) |
| 585 return; | 586 return; |
| 586 | 587 |
| 587 if (is_data_usage_off_the_record_) { | 588 if (is_data_usage_off_the_record_) { |
| 588 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 589 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
| 589 return; | 590 return; |
| 590 } | 591 } |
| 591 | 592 |
| 592 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 593 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
| 593 } | 594 } |
| OLD | NEW |