OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/custom_handlers/protocol_handler_registry.h" | 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
9 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 9 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
10 #include "chrome/browser/extensions/extension_proxy_api.h" | 10 #include "chrome/browser/extensions/extension_proxy_api.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 ChromeNetworkDelegate::~ChromeNetworkDelegate() {} | 46 ChromeNetworkDelegate::~ChromeNetworkDelegate() {} |
47 | 47 |
48 bool ChromeNetworkDelegate::OnBeforeURLRequest( | 48 bool ChromeNetworkDelegate::OnBeforeURLRequest( |
49 net::URLRequest* request, net::CompletionCallback* callback) { | 49 net::URLRequest* request, net::CompletionCallback* callback) { |
50 return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeRequest( | 50 return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeRequest( |
51 profile_id_, event_router_.get(), request, callback); | 51 profile_id_, event_router_.get(), request, callback); |
52 } | 52 } |
53 | 53 |
54 void ChromeNetworkDelegate::OnSendHttpRequest( | 54 bool ChromeNetworkDelegate::OnBeforeSendHeaders( |
55 net::HttpRequestHeaders* headers) { | 55 uint64 request_id, |
56 DCHECK(headers); | 56 net::HttpRequestHeaders* headers, |
| 57 net::CompletionCallback* callback) { |
| 58 return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeSendHeaders( |
| 59 profile_id_, event_router_.get(), request_id, headers, callback); |
57 } | 60 } |
58 | 61 |
59 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request) { | 62 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request) { |
60 ForwardProxyErrors(request, event_router_.get(), profile_id_); | 63 ForwardProxyErrors(request, event_router_.get(), profile_id_); |
61 } | 64 } |
62 | 65 |
63 void ChromeNetworkDelegate::OnReadCompleted(net::URLRequest* request, | 66 void ChromeNetworkDelegate::OnReadCompleted(net::URLRequest* request, |
64 int bytes_read) { | 67 int bytes_read) { |
65 ForwardProxyErrors(request, event_router_.get(), profile_id_); | 68 ForwardProxyErrors(request, event_router_.get(), profile_id_); |
66 } | 69 } |
67 | 70 |
68 net::URLRequestJob* ChromeNetworkDelegate::OnMaybeCreateURLRequestJob( | 71 net::URLRequestJob* ChromeNetworkDelegate::OnMaybeCreateURLRequestJob( |
69 net::URLRequest* request) { | 72 net::URLRequest* request) { |
70 if (!protocol_handler_registry_) | 73 if (!protocol_handler_registry_) |
71 return NULL; | 74 return NULL; |
72 return protocol_handler_registry_->MaybeCreateJob(request); | 75 return protocol_handler_registry_->MaybeCreateJob(request); |
73 } | 76 } |
OLD | NEW |