Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 6698009: Add request_id to HttpRequestInfo and pass it to the NetworkDelegate for events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: delegate callbcak Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698