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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/api/prefs/pref_member.h" | 8 #include "chrome/browser/api/prefs/pref_member.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/content_settings/cookie_settings.h" | 10 #include "chrome/browser/content_settings/cookie_settings.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 performance_monitor::PerformanceMonitor::GetInstance()->BytesReadOnIOThread( | 252 performance_monitor::PerformanceMonitor::GetInstance()->BytesReadOnIOThread( |
253 request, bytes_read); | 253 request, bytes_read); |
254 | 254 |
255 #if defined(ENABLE_TASK_MANAGER) | 255 #if defined(ENABLE_TASK_MANAGER) |
256 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); | 256 TaskManager::GetInstance()->model()->NotifyBytesRead(request, bytes_read); |
257 #endif // defined(ENABLE_TASK_MANAGER) | 257 #endif // defined(ENABLE_TASK_MANAGER) |
258 } | 258 } |
259 | 259 |
260 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, | 260 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, |
261 bool started) { | 261 bool started) { |
262 if (request->status().status() == net::URLRequestStatus::SUCCESS || | 262 if (request->status().status() == net::URLRequestStatus::SUCCESS) { |
263 request->status().status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { | |
264 bool is_redirect = request->response_headers() && | 263 bool is_redirect = request->response_headers() && |
265 net::HttpResponseHeaders::IsRedirectResponseCode( | 264 net::HttpResponseHeaders::IsRedirectResponseCode( |
266 request->response_headers()->response_code()); | 265 request->response_headers()->response_code()); |
267 if (!is_redirect) { | 266 if (!is_redirect) { |
268 ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( | 267 ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( |
269 profile_, extension_info_map_.get(), request); | 268 profile_, extension_info_map_.get(), request); |
270 } | 269 } |
271 } else if (request->status().status() == net::URLRequestStatus::FAILED || | 270 } else if (request->status().status() == net::URLRequestStatus::FAILED || |
272 request->status().status() == net::URLRequestStatus::CANCELED) { | 271 request->status().status() == net::URLRequestStatus::CANCELED) { |
273 ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred( | 272 ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred( |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 #endif | 414 #endif |
416 return net::OK; | 415 return net::OK; |
417 } | 416 } |
418 | 417 |
419 void ChromeNetworkDelegate::OnRequestWaitStateChange( | 418 void ChromeNetworkDelegate::OnRequestWaitStateChange( |
420 const net::URLRequest& request, | 419 const net::URLRequest& request, |
421 RequestWaitState state) { | 420 RequestWaitState state) { |
422 if (load_time_stats_) | 421 if (load_time_stats_) |
423 load_time_stats_->OnRequestWaitStateChange(request, state); | 422 load_time_stats_->OnRequestWaitStateChange(request, state); |
424 } | 423 } |
OLD | NEW |