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

Unified Diff: content/public/child/request_peer.h

Issue 1103813002: Make WebURLLoader capable of retaining received buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« content/child/web_url_loader_impl.cc ('K') | « content/content_child.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/child/request_peer.h
diff --git a/content/public/child/request_peer.h b/content/public/child/request_peer.h
index dfa7a7417ea3d9a6ad36c979fa3b60b1c1e305dd..82d2842dfc526c1ccc0fd5bedd7c26df713dcce5 100644
--- a/content/public/child/request_peer.h
+++ b/content/public/child/request_peer.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
class GURL;
@@ -33,6 +34,20 @@ struct ResourceResponseInfo;
// for more information.
class CONTENT_EXPORT RequestPeer {
public:
+ // This class represents data gotten from the Browser process. Each data
+ // consists of |payload|, |length| and |encoded_length|. The payload is
+ // valid only when the data instance is valid.
+ class ReceivedData {
+ public:
+ virtual ~ReceivedData() {}
+ virtual const char* payload() const = 0;
+ virtual int length() const = 0;
+ // The encoded_data_length is the length of the encoded data transferred
tyoshino (SeeGerritForStatus) 2015/04/27 05:20:15 encoded_length
yhirano 2015/04/27 05:29:38 Done.
+ // over the network, which could be different from data length (e.g. for
+ // gzipped content).
+ virtual int encoded_length() const = 0;
+ };
+
// Called as upload progress is made.
// note: only for requests with upload progress enabled.
virtual void OnUploadProgress(uint64 position, uint64 size) = 0;
@@ -59,12 +74,7 @@ class CONTENT_EXPORT RequestPeer {
// Called when a chunk of response data is available. This method may
// be called multiple times or not at all if an error occurs.
- // The encoded_data_length is the length of the encoded data transferred
- // over the network, which could be different from data length (e.g. for
- // gzipped content).
- virtual void OnReceivedData(const char* data,
- int data_length,
- int encoded_data_length) = 0;
+ virtual void OnReceivedData(scoped_ptr<ReceivedData> data) = 0;
// Called when metadata generated by the renderer is retrieved from the
// cache. This method may be called zero or one times.
« content/child/web_url_loader_impl.cc ('K') | « content/content_child.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698