| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ | 5 #ifndef CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ |
| 6 #define CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ | 6 #define CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 virtual ~ReceivedData() {} | 46 virtual ~ReceivedData() {} |
| 47 virtual const char* payload() const = 0; | 47 virtual const char* payload() const = 0; |
| 48 virtual int length() const = 0; | 48 virtual int length() const = 0; |
| 49 // The encoded_length is the length of the encoded data transferred | 49 // The encoded_length is the length of the encoded data transferred |
| 50 // over the network, which could be different from data length (e.g. for | 50 // over the network, which could be different from data length (e.g. for |
| 51 // gzipped content). | 51 // gzipped content). |
| 52 virtual int encoded_length() const = 0; | 52 virtual int encoded_length() const = 0; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // A ThreadSafeReceivedData can be deleted on ANY thread. |
| 56 class CONTENT_EXPORT ThreadSafeReceivedData : public ReceivedData {}; |
| 57 |
| 55 // Called as upload progress is made. | 58 // Called as upload progress is made. |
| 56 // note: only for requests with upload progress enabled. | 59 // note: only for requests with upload progress enabled. |
| 57 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; | 60 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; |
| 58 | 61 |
| 59 // Called when a redirect occurs. The implementation may return false to | 62 // Called when a redirect occurs. The implementation may return false to |
| 60 // suppress the redirect. The ResourceResponseInfo provides information about | 63 // suppress the redirect. The ResourceResponseInfo provides information about |
| 61 // the redirect response and the RedirectInfo includes information about the | 64 // the redirect response and the RedirectInfo includes information about the |
| 62 // request to be made if the method returns true. | 65 // request to be made if the method returns true. |
| 63 virtual bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, | 66 virtual bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, |
| 64 const ResourceResponseInfo& info) = 0; | 67 const ResourceResponseInfo& info) = 0; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 93 const base::TimeTicks& completion_time, | 96 const base::TimeTicks& completion_time, |
| 94 int64 total_transfer_size) = 0; | 97 int64 total_transfer_size) = 0; |
| 95 | 98 |
| 96 protected: | 99 protected: |
| 97 virtual ~RequestPeer() {} | 100 virtual ~RequestPeer() {} |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 } // namespace content | 103 } // namespace content |
| 101 | 104 |
| 102 #endif // CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ | 105 #endif // CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ |
| OLD | NEW |