| 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.
|
|
|