Chromium Code Reviews| 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. |