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

Unified Diff: net/base/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, 4 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 side-by-side diff with in-line comments
Download patch
Index: net/base/network_delegate.cc
diff --git a/net/base/network_delegate.cc b/net/base/network_delegate.cc
index a2ca52b3769a287c9f120e454882a7e30739f3bb..7a6db20f2f8d4e0b896f7a32f1bd75377a8d0eab 100644
--- a/net/base/network_delegate.cc
+++ b/net/base/network_delegate.cc
@@ -78,12 +78,23 @@ int NetworkDelegate::NotifyHeadersReceived(
allowed_unsafe_redirect_url);
}
-void NetworkDelegate::NotifyResponseStarted(URLRequest* request) {
+void NetworkDelegate::NotifyResponseStarted(URLRequest* request,
+ int net_error) {
DCHECK(CalledOnValidThread());
DCHECK(request);
+
+ OnResponseStarted(request, net_error);
+}
+
+void NetworkDelegate::OnResponseStarted(URLRequest* request, int net_error) {
OnResponseStarted(request);
}
+// Deprecated
+void NetworkDelegate::OnResponseStarted(URLRequest* request) {
+ NOTREACHED();
+}
mmenke 2016/08/30 22:09:11 Order in this file should match order in the heade
maksims (do not use this acc) 2016/08/31 11:16:59 Done.
+
void NetworkDelegate::NotifyNetworkBytesReceived(URLRequest* request,
int64_t bytes_received) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
@@ -107,7 +118,9 @@ void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request,
OnBeforeRedirect(request, new_location);
}
-void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) {
+void NetworkDelegate::NotifyCompleted(URLRequest* request,
+ bool started,
+ int net_error) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
"NetworkDelegate::NotifyCompleted");
DCHECK(CalledOnValidThread());
@@ -115,9 +128,21 @@ void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) {
// TODO(cbentzel): Remove ScopedTracker below once crbug.com/475753 is fixed.
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION("475753 NetworkDelegate::OnCompleted"));
+
+ OnCompleted(request, started, net_error);
+}
+
+void NetworkDelegate::OnCompleted(URLRequest* request,
+ bool started,
+ int net_error) {
OnCompleted(request, started);
}
+// Deprecated.
+void NetworkDelegate::OnCompleted(URLRequest* request, bool started) {
+ NOTREACHED();
+}
mmenke 2016/08/30 22:09:11 Order in this file should match order in the heade
maksims (do not use this acc) 2016/08/31 11:16:59 Done.
+
void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
"NetworkDelegate::NotifyURLRequestDestroyed");

Powered by Google App Engine
This is Rietveld 408576698