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

Unified Diff: net/base/network_delegate_impl.h

Issue 1284993005: Notify NetworkDelegate when bytes have been received over the network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty cronet OnRawBytesRead implementation Created 5 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
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/base/network_delegate_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_delegate_impl.h
diff --git a/net/base/network_delegate_impl.h b/net/base/network_delegate_impl.h
index 1f1c779d2d9e88f95bbb251bb4a8e2de32376436..7a2318899396d99f87e537fa9346838016ddd447 100644
--- a/net/base/network_delegate_impl.h
+++ b/net/base/network_delegate_impl.h
@@ -5,6 +5,8 @@
#ifndef NET_BASE_NETWORK_DELEGATE_IMPL_H_
#define NET_BASE_NETWORK_DELEGATE_IMPL_H_
+#include <stdint.h>
+
#include "base/strings/string16.h"
#include "net/base/completion_callback.h"
#include "net/base/network_delegate.h"
@@ -115,8 +117,16 @@ class NET_EXPORT NetworkDelegateImpl : public NetworkDelegate {
// This corresponds to URLRequestDelegate::OnResponseStarted.
void OnResponseStarted(URLRequest* request) override;
- // Called every time we read raw bytes.
- void OnRawBytesRead(const URLRequest& request, int bytes_read) override;
+ // Called when bytes are received from the network, such as after receiving
+ // headers or reading raw response bytes. This includes localhost requests.
+ // |bytes_received| is the number of bytes measured at the application layer
+ // that have been received over the network for this request since the last
+ // time OnNetworkBytesReceived was called. |bytes_received| will always be
+ // greater than 0.
+ // Currently, this is only implemented for HTTP transactions, and
+ // |bytes_received| does not include TLS overhead or TCP retransmits.
+ void OnNetworkBytesReceived(const URLRequest& request,
+ int64_t bytes_received) override;
// Indicates that the URL request has been completed or failed.
// |started| indicates whether the request has been started. If false,
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/base/network_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698