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

Side by Side Diff: net/base/network_delegate.cc

Issue 1362793003: Notify NetworkDelegate when bytes have been sent over the network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patch set Created 5 years, 2 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
OLDNEW
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 "net/base/network_delegate.h" 5 #include "net/base/network_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "net/base/load_flags.h" 9 #include "net/base/load_flags.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 DCHECK(headers); 60 DCHECK(headers);
61 OnBeforeSendProxyHeaders(request, proxy_info, headers); 61 OnBeforeSendProxyHeaders(request, proxy_info, headers);
62 } 62 }
63 63
64 void NetworkDelegate::NotifySendHeaders(URLRequest* request, 64 void NetworkDelegate::NotifySendHeaders(URLRequest* request,
65 const HttpRequestHeaders& headers) { 65 const HttpRequestHeaders& headers) {
66 DCHECK(CalledOnValidThread()); 66 DCHECK(CalledOnValidThread());
67 OnSendHeaders(request, headers); 67 OnSendHeaders(request, headers);
68 } 68 }
69 69
70 void NetworkDelegate::NotifyNetworkBytesSent(const URLRequest& request,
71 int64_t bytes_sent) {
72 DCHECK(CalledOnValidThread());
73 DCHECK_GT(bytes_sent, 0);
74 OnNetworkBytesSent(request, bytes_sent);
75 }
76
70 int NetworkDelegate::NotifyHeadersReceived( 77 int NetworkDelegate::NotifyHeadersReceived(
71 URLRequest* request, 78 URLRequest* request,
72 const CompletionCallback& callback, 79 const CompletionCallback& callback,
73 const HttpResponseHeaders* original_response_headers, 80 const HttpResponseHeaders* original_response_headers,
74 scoped_refptr<HttpResponseHeaders>* override_response_headers, 81 scoped_refptr<HttpResponseHeaders>* override_response_headers,
75 GURL* allowed_unsafe_redirect_url) { 82 GURL* allowed_unsafe_redirect_url) {
76 DCHECK(CalledOnValidThread()); 83 DCHECK(CalledOnValidThread());
77 DCHECK(original_response_headers); 84 DCHECK(original_response_headers);
78 DCHECK(!callback.is_null()); 85 DCHECK(!callback.is_null());
79 return OnHeadersReceived(request, 86 return OnHeadersReceived(request,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( 181 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader(
175 const URLRequest& request, 182 const URLRequest& request,
176 const GURL& target_url, 183 const GURL& target_url,
177 const GURL& referrer_url) const { 184 const GURL& referrer_url) const {
178 DCHECK(CalledOnValidThread()); 185 DCHECK(CalledOnValidThread());
179 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( 186 return OnCancelURLRequestWithPolicyViolatingReferrerHeader(
180 request, target_url, referrer_url); 187 request, target_url, referrer_url);
181 } 188 }
182 189
183 } // namespace net 190 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698