Chromium Code Reviews| 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 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | |
| 262 if (request->status().status() == net::URLRequestStatus::SUCCESS || | 263 if (request->status().status() == net::URLRequestStatus::SUCCESS || |
| 263 request->status().status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { | 264 (info && info->WasIgnoredByHandler())) { |
|
darin (slow to review)
2012/08/30 16:15:18
Sorry, my suggestion was to write the code like th
mkosiba (inactive)
2012/08/31 14:45:10
After a bit of browsing the code I think the line
| |
| 264 bool is_redirect = request->response_headers() && | 265 bool is_redirect = request->response_headers() && |
| 265 net::HttpResponseHeaders::IsRedirectResponseCode( | 266 net::HttpResponseHeaders::IsRedirectResponseCode( |
| 266 request->response_headers()->response_code()); | 267 request->response_headers()->response_code()); |
| 267 if (!is_redirect) { | 268 if (!is_redirect) { |
| 268 ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( | 269 ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( |
| 269 profile_, extension_info_map_.get(), request); | 270 profile_, extension_info_map_.get(), request); |
| 270 } | 271 } |
| 271 } else if (request->status().status() == net::URLRequestStatus::FAILED || | 272 } else if (request->status().status() == net::URLRequestStatus::FAILED || |
| 272 request->status().status() == net::URLRequestStatus::CANCELED) { | 273 request->status().status() == net::URLRequestStatus::CANCELED) { |
| 273 ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred( | 274 ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred( |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 #endif | 416 #endif |
| 416 return net::OK; | 417 return net::OK; |
| 417 } | 418 } |
| 418 | 419 |
| 419 void ChromeNetworkDelegate::OnRequestWaitStateChange( | 420 void ChromeNetworkDelegate::OnRequestWaitStateChange( |
| 420 const net::URLRequest& request, | 421 const net::URLRequest& request, |
| 421 RequestWaitState state) { | 422 RequestWaitState state) { |
| 422 if (load_time_stats_) | 423 if (load_time_stats_) |
| 423 load_time_stats_->OnRequestWaitStateChange(request, state); | 424 load_time_stats_->OnRequestWaitStateChange(request, state); |
| 424 } | 425 } |
| OLD | NEW |