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

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, 7 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 | « content/public/child/fixed_received_data.cc ('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..2322792ef30d16618b3a1afa95526b543095e405 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,24 @@ 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.
+ // In order to work with Chrome resource loading IPC, it is desirable to
+ // reclaim data in FIFO order in a RequestPeer in terms of performance.
+ // |payload|, |length| and |encoded_length| functions are thread-safe, but
+ // the data object itself must be destroyed on the original thread.
+ class CONTENT_EXPORT ReceivedData {
+ public:
+ virtual ~ReceivedData() {}
+ virtual const char* payload() const = 0;
+ virtual int length() const = 0;
+ // The encoded_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 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 +78,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.
« no previous file with comments | « content/public/child/fixed_received_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698