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

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: rebased 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) { 107 void LayeredNetworkDelegate::OnResponseStarted(URLRequest* request,
108 int net_error) {
108 OnResponseStartedInternal(request); 109 OnResponseStartedInternal(request);
109 nested_network_delegate_->NotifyResponseStarted(request); 110 nested_network_delegate_->NotifyResponseStarted(request, net_error);
110 } 111 }
111 112
112 void LayeredNetworkDelegate::OnResponseStartedInternal(URLRequest* request) { 113 void LayeredNetworkDelegate::OnResponseStartedInternal(URLRequest* request) {
113 } 114 }
114 115
115 void LayeredNetworkDelegate::OnNetworkBytesReceived(URLRequest* request, 116 void LayeredNetworkDelegate::OnNetworkBytesReceived(URLRequest* request,
116 int64_t bytes_received) { 117 int64_t bytes_received) {
117 OnNetworkBytesReceivedInternal(request, bytes_received); 118 OnNetworkBytesReceivedInternal(request, bytes_received);
118 nested_network_delegate_->NotifyNetworkBytesReceived(request, bytes_received); 119 nested_network_delegate_->NotifyNetworkBytesReceived(request, bytes_received);
119 } 120 }
120 121
121 void LayeredNetworkDelegate::OnNetworkBytesReceivedInternal( 122 void LayeredNetworkDelegate::OnNetworkBytesReceivedInternal(
122 URLRequest* request, 123 URLRequest* request,
123 int64_t bytes_received) {} 124 int64_t bytes_received) {}
124 125
125 void LayeredNetworkDelegate::OnNetworkBytesSent(URLRequest* request, 126 void LayeredNetworkDelegate::OnNetworkBytesSent(URLRequest* request,
126 int64_t bytes_sent) { 127 int64_t bytes_sent) {
127 OnNetworkBytesSentInternal(request, bytes_sent); 128 OnNetworkBytesSentInternal(request, bytes_sent);
128 nested_network_delegate_->NotifyNetworkBytesSent(request, bytes_sent); 129 nested_network_delegate_->NotifyNetworkBytesSent(request, bytes_sent);
129 } 130 }
130 131
131 void LayeredNetworkDelegate::OnNetworkBytesSentInternal(URLRequest* request, 132 void LayeredNetworkDelegate::OnNetworkBytesSentInternal(URLRequest* request,
132 int64_t bytes_sent) {} 133 int64_t bytes_sent) {}
133 134
134 void LayeredNetworkDelegate::OnCompleted(URLRequest* request, bool started) { 135 void LayeredNetworkDelegate::OnCompleted(URLRequest* request,
136 bool started,
137 int net_error) {
135 OnCompletedInternal(request, started); 138 OnCompletedInternal(request, started);
136 nested_network_delegate_->NotifyCompleted(request, started); 139 nested_network_delegate_->NotifyCompleted(request, started, net_error);
137 } 140 }
138 141
139 void LayeredNetworkDelegate::OnCompletedInternal(URLRequest* request, 142 void LayeredNetworkDelegate::OnCompletedInternal(URLRequest* request,
140 bool started) { 143 bool started) {}
141 }
142 144
143 void LayeredNetworkDelegate::OnURLRequestDestroyed(URLRequest* request) { 145 void LayeredNetworkDelegate::OnURLRequestDestroyed(URLRequest* request) {
144 OnURLRequestDestroyedInternal(request); 146 OnURLRequestDestroyedInternal(request);
145 nested_network_delegate_->NotifyURLRequestDestroyed(request); 147 nested_network_delegate_->NotifyURLRequestDestroyed(request);
146 } 148 }
147 149
148 void LayeredNetworkDelegate::OnURLRequestDestroyedInternal( 150 void LayeredNetworkDelegate::OnURLRequestDestroyedInternal(
149 URLRequest* request) { 151 URLRequest* request) {
150 } 152 }
151 153
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 255 }
254 256
255 void LayeredNetworkDelegate:: 257 void LayeredNetworkDelegate::
256 OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal( 258 OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal(
257 const URLRequest& request, 259 const URLRequest& request,
258 const GURL& target_url, 260 const GURL& target_url,
259 const GURL& referrer_url) const { 261 const GURL& referrer_url) const {
260 } 262 }
261 263
262 } // namespace net 264 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698