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 "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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 DCHECK(request); | 88 DCHECK(request); |
| 89 OnResponseStarted(request); | 89 OnResponseStarted(request); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void NetworkDelegate::NotifyRawBytesRead(const URLRequest& request, | 92 void NetworkDelegate::NotifyRawBytesRead(const URLRequest& request, |
| 93 int bytes_read) { | 93 int bytes_read) { |
| 94 DCHECK(CalledOnValidThread()); | 94 DCHECK(CalledOnValidThread()); |
| 95 OnRawBytesRead(request, bytes_read); | 95 OnRawBytesRead(request, bytes_read); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void NetworkDelegate::NotifyNetworkBytesReceived(const URLRequest& request, | |
| 99 int64_t bytes_received) { | |
| 100 DCHECK(CalledOnValidThread()); | |
| 101 DCHECK_GT(bytes_received, 0); | |
| 102 OnNetworkBytesReceived(request, bytes_received); | |
|
mmenke
2015/08/18 18:33:12
What's the difference between a raw byte read and
sclittle
2015/08/18 18:49:41
The main difficulty would be getting the delta |by
mmenke
2015/08/18 18:56:07
I'm strongly opposed to having two methods for thi
sclittle
2015/08/18 20:13:42
From a quick code search it looks like you're righ
sclittle
2015/08/18 20:20:26
Another alternative might just be to add an int64
| |
| 103 } | |
| 104 | |
| 98 void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request, | 105 void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request, |
| 99 const GURL& new_location) { | 106 const GURL& new_location) { |
| 100 DCHECK(CalledOnValidThread()); | 107 DCHECK(CalledOnValidThread()); |
| 101 DCHECK(request); | 108 DCHECK(request); |
| 102 OnBeforeRedirect(request, new_location); | 109 OnBeforeRedirect(request, new_location); |
| 103 } | 110 } |
| 104 | 111 |
| 105 void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) { | 112 void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) { |
| 106 DCHECK(CalledOnValidThread()); | 113 DCHECK(CalledOnValidThread()); |
| 107 DCHECK(request); | 114 DCHECK(request); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( | 174 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( |
| 168 const URLRequest& request, | 175 const URLRequest& request, |
| 169 const GURL& target_url, | 176 const GURL& target_url, |
| 170 const GURL& referrer_url) const { | 177 const GURL& referrer_url) const { |
| 171 DCHECK(CalledOnValidThread()); | 178 DCHECK(CalledOnValidThread()); |
| 172 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 179 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 173 request, target_url, referrer_url); | 180 request, target_url, referrer_url); |
| 174 } | 181 } |
| 175 | 182 |
| 176 } // namespace net | 183 } // namespace net |
| OLD | NEW |