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

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

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layered_network_delegate.h" 5 #include "net/base/layered_network_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const GURL& new_location) { 97 const GURL& new_location) {
98 OnBeforeRedirectInternal(request, new_location); 98 OnBeforeRedirectInternal(request, new_location);
99 nested_network_delegate_->NotifyBeforeRedirect(request, new_location); 99 nested_network_delegate_->NotifyBeforeRedirect(request, new_location);
100 } 100 }
101 101
102 void LayeredNetworkDelegate::OnBeforeRedirectInternal( 102 void LayeredNetworkDelegate::OnBeforeRedirectInternal(
103 URLRequest* request, 103 URLRequest* request,
104 const GURL& new_location) { 104 const GURL& new_location) {
105 } 105 }
106 106
107 void LayeredNetworkDelegate::OnResponseStarted(URLRequest* request,
108 int net_error) {
109 OnResponseStartedInternal(request);
110 nested_network_delegate_->NotifyResponseStarted(request, net_error);
111 }
112
113 // Deprecated
107 void LayeredNetworkDelegate::OnResponseStarted(URLRequest* request) { 114 void LayeredNetworkDelegate::OnResponseStarted(URLRequest* request) {
108 OnResponseStartedInternal(request); 115 OnResponseStartedInternal(request);
109 nested_network_delegate_->NotifyResponseStarted(request); 116 nested_network_delegate_->NotifyResponseStarted(request);
110 } 117 }
111 118
112 void LayeredNetworkDelegate::OnResponseStartedInternal(URLRequest* request) { 119 void LayeredNetworkDelegate::OnResponseStartedInternal(URLRequest* request) {
113 } 120 }
114 121
115 void LayeredNetworkDelegate::OnNetworkBytesReceived(URLRequest* request, 122 void LayeredNetworkDelegate::OnNetworkBytesReceived(URLRequest* request,
116 int64_t bytes_received) { 123 int64_t bytes_received) {
117 OnNetworkBytesReceivedInternal(request, bytes_received); 124 OnNetworkBytesReceivedInternal(request, bytes_received);
118 nested_network_delegate_->NotifyNetworkBytesReceived(request, bytes_received); 125 nested_network_delegate_->NotifyNetworkBytesReceived(request, bytes_received);
119 } 126 }
120 127
121 void LayeredNetworkDelegate::OnNetworkBytesReceivedInternal( 128 void LayeredNetworkDelegate::OnNetworkBytesReceivedInternal(
122 URLRequest* request, 129 URLRequest* request,
123 int64_t bytes_received) {} 130 int64_t bytes_received) {}
124 131
125 void LayeredNetworkDelegate::OnNetworkBytesSent(URLRequest* request, 132 void LayeredNetworkDelegate::OnNetworkBytesSent(URLRequest* request,
126 int64_t bytes_sent) { 133 int64_t bytes_sent) {
127 OnNetworkBytesSentInternal(request, bytes_sent); 134 OnNetworkBytesSentInternal(request, bytes_sent);
128 nested_network_delegate_->NotifyNetworkBytesSent(request, bytes_sent); 135 nested_network_delegate_->NotifyNetworkBytesSent(request, bytes_sent);
129 } 136 }
130 137
131 void LayeredNetworkDelegate::OnNetworkBytesSentInternal(URLRequest* request, 138 void LayeredNetworkDelegate::OnNetworkBytesSentInternal(URLRequest* request,
132 int64_t bytes_sent) {} 139 int64_t bytes_sent) {}
133 140
141 void LayeredNetworkDelegate::OnCompleted(URLRequest* request,
142 bool started,
143 int net_error) {
144 OnCompletedInternal(request, started);
145 nested_network_delegate_->NotifyCompleted(request, started, net_error);
146 }
147
148 // Deprecated.
134 void LayeredNetworkDelegate::OnCompleted(URLRequest* request, bool started) { 149 void LayeredNetworkDelegate::OnCompleted(URLRequest* request, bool started) {
135 OnCompletedInternal(request, started); 150 OnCompletedInternal(request, started);
136 nested_network_delegate_->NotifyCompleted(request, started); 151 nested_network_delegate_->NotifyCompleted(request, started);
137 } 152 }
138 153
139 void LayeredNetworkDelegate::OnCompletedInternal(URLRequest* request, 154 void LayeredNetworkDelegate::OnCompletedInternal(URLRequest* request,
140 bool started) { 155 bool started) {}
141 }
142 156
143 void LayeredNetworkDelegate::OnURLRequestDestroyed(URLRequest* request) { 157 void LayeredNetworkDelegate::OnURLRequestDestroyed(URLRequest* request) {
144 OnURLRequestDestroyedInternal(request); 158 OnURLRequestDestroyedInternal(request);
145 nested_network_delegate_->NotifyURLRequestDestroyed(request); 159 nested_network_delegate_->NotifyURLRequestDestroyed(request);
146 } 160 }
147 161
148 void LayeredNetworkDelegate::OnURLRequestDestroyedInternal( 162 void LayeredNetworkDelegate::OnURLRequestDestroyedInternal(
149 URLRequest* request) { 163 URLRequest* request) {
150 } 164 }
151 165
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 267 }
254 268
255 void LayeredNetworkDelegate:: 269 void LayeredNetworkDelegate::
256 OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal( 270 OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal(
257 const URLRequest& request, 271 const URLRequest& request,
258 const GURL& target_url, 272 const GURL& target_url,
259 const GURL& referrer_url) const { 273 const GURL& referrer_url) const {
260 } 274 }
261 275
262 } // namespace net 276 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698