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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class TimeTicks; | 18 class TimeTicks; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 struct RedirectInfo; | 22 struct RedirectInfo; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // called multiple times or not at all if an error occurs. This method is | 75 // called multiple times or not at all if an error occurs. This method is |
76 // only called if RequestInfo::download_to_file was set to true, and in | 76 // only called if RequestInfo::download_to_file was set to true, and in |
77 // that case, OnReceivedData will not be called. | 77 // that case, OnReceivedData will not be called. |
78 // The encoded_data_length is the length of the encoded data transferred | 78 // The encoded_data_length is the length of the encoded data transferred |
79 // over the network, which could be different from data length (e.g. for | 79 // over the network, which could be different from data length (e.g. for |
80 // gzipped content). | 80 // gzipped content). |
81 virtual void OnDownloadedData(int len, int encoded_data_length) = 0; | 81 virtual void OnDownloadedData(int len, int encoded_data_length) = 0; |
82 | 82 |
83 // Called when a chunk of response data is available. This method may | 83 // Called when a chunk of response data is available. This method may |
84 // be called multiple times or not at all if an error occurs. | 84 // be called multiple times or not at all if an error occurs. |
85 virtual void OnReceivedData(scoped_ptr<ReceivedData> data) = 0; | 85 virtual void OnReceivedData(std::unique_ptr<ReceivedData> data) = 0; |
86 | 86 |
87 // Called when metadata generated by the renderer is retrieved from the | 87 // Called when metadata generated by the renderer is retrieved from the |
88 // cache. This method may be called zero or one times. | 88 // cache. This method may be called zero or one times. |
89 virtual void OnReceivedCachedMetadata(const char* data, int len) {} | 89 virtual void OnReceivedCachedMetadata(const char* data, int len) {} |
90 | 90 |
91 // Called when the response is complete. This method signals completion of | 91 // Called when the response is complete. This method signals completion of |
92 // the resource load. | 92 // the resource load. |
93 virtual void OnCompletedRequest(int error_code, | 93 virtual void OnCompletedRequest(int error_code, |
94 bool was_ignored_by_handler, | 94 bool was_ignored_by_handler, |
95 bool stale_copy_in_cache, | 95 bool stale_copy_in_cache, |
96 const std::string& security_info, | 96 const std::string& security_info, |
97 const base::TimeTicks& completion_time, | 97 const base::TimeTicks& completion_time, |
98 int64_t total_transfer_size) = 0; | 98 int64_t total_transfer_size) = 0; |
99 | 99 |
100 virtual ~RequestPeer() {} | 100 virtual ~RequestPeer() {} |
101 }; | 101 }; |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ | 105 #endif // CONTENT_PUBLIC_CHILD_REQUEST_PEER_H_ |
OLD | NEW |