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::OnBeforeHttpRequest( |
55 net::HttpRequestHeaders* headers) { | 55 uint64 request_id, |
56 net::HttpRequestHeaders* headers, | |
57 net::CompletionCallback* callback) { | |
56 DCHECK(headers); | 58 DCHECK(headers); |
willchan no longer on Chromium
2011/03/17 15:55:54
You can whack this DCHECK(), it should have been v
Matt Perry
2011/03/22 21:11:43
Done.
| |
59 return ExtensionWebRequestEventRouter::GetInstance()->OnBeforeHttpRequest( | |
60 profile_id_, event_router_.get(), request_id, headers, callback); | |
57 } | 61 } |
58 | 62 |
59 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request) { | 63 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request) { |
60 ForwardProxyErrors(request, event_router_.get(), profile_id_); | 64 ForwardProxyErrors(request, event_router_.get(), profile_id_); |
61 } | 65 } |
62 | 66 |
63 void ChromeNetworkDelegate::OnReadCompleted(net::URLRequest* request, | 67 void ChromeNetworkDelegate::OnReadCompleted(net::URLRequest* request, |
64 int bytes_read) { | 68 int bytes_read) { |
65 ForwardProxyErrors(request, event_router_.get(), profile_id_); | 69 ForwardProxyErrors(request, event_router_.get(), profile_id_); |
66 } | 70 } |
67 | 71 |
68 net::URLRequestJob* ChromeNetworkDelegate::OnMaybeCreateURLRequestJob( | 72 net::URLRequestJob* ChromeNetworkDelegate::OnMaybeCreateURLRequestJob( |
69 net::URLRequest* request) { | 73 net::URLRequest* request) { |
70 if (!protocol_handler_registry_) | 74 if (!protocol_handler_registry_) |
71 return NULL; | 75 return NULL; |
72 return protocol_handler_registry_->MaybeCreateJob(request); | 76 return protocol_handler_registry_->MaybeCreateJob(request); |
73 } | 77 } |
OLD | NEW |