OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 5 #ifndef CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
6 #define CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 6 #define CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const std::string& mime_type); | 57 const std::string& mime_type); |
58 ~BufferedPeer() override; | 58 ~BufferedPeer() override; |
59 | 59 |
60 // content::RequestPeer Implementation. | 60 // content::RequestPeer Implementation. |
61 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; | 61 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; |
62 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; | 62 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; |
63 void OnCompletedRequest(int error_code, | 63 void OnCompletedRequest(int error_code, |
64 bool was_ignored_by_handler, | 64 bool was_ignored_by_handler, |
65 bool stale_copy_in_cache, | 65 bool stale_copy_in_cache, |
66 const base::TimeTicks& completion_time, | 66 const base::TimeTicks& completion_time, |
67 int64_t total_transfer_size) override; | 67 int64_t total_transfer_size, |
| 68 int64_t encoded_body_size) override; |
68 | 69 |
69 protected: | 70 protected: |
70 // Invoked when the entire request has been processed before the data is sent | 71 // Invoked when the entire request has been processed before the data is sent |
71 // to the original peer, giving an opportunity to subclasses to process the | 72 // to the original peer, giving an opportunity to subclasses to process the |
72 // data in data_. If this method returns true, the data is fed to the | 73 // data in data_. If this method returns true, the data is fed to the |
73 // original peer, if it returns false, an error is sent instead. | 74 // original peer, if it returns false, an error is sent instead. |
74 virtual bool DataReady() = 0; | 75 virtual bool DataReady() = 0; |
75 | 76 |
76 content::ResourceResponseInfo response_info_; | 77 content::ResourceResponseInfo response_info_; |
77 std::string data_; | 78 std::string data_; |
(...skipping 17 matching lines...) Expand all Loading... |
95 const std::string& data); | 96 const std::string& data); |
96 ~ReplaceContentPeer() override; | 97 ~ReplaceContentPeer() override; |
97 | 98 |
98 // content::RequestPeer Implementation. | 99 // content::RequestPeer Implementation. |
99 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; | 100 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; |
100 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; | 101 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; |
101 void OnCompletedRequest(int error_code, | 102 void OnCompletedRequest(int error_code, |
102 bool was_ignored_by_handler, | 103 bool was_ignored_by_handler, |
103 bool stale_copy_in_cache, | 104 bool stale_copy_in_cache, |
104 const base::TimeTicks& completion_time, | 105 const base::TimeTicks& completion_time, |
105 int64_t total_transfer_size) override; | 106 int64_t total_transfer_size, |
| 107 int64_t encoded_body_size) override; |
106 | 108 |
107 private: | 109 private: |
108 content::ResourceResponseInfo response_info_; | 110 content::ResourceResponseInfo response_info_; |
109 std::string mime_type_; | 111 std::string mime_type_; |
110 std::string data_; | 112 std::string data_; |
111 | 113 |
112 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); | 114 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); |
113 }; | 115 }; |
114 | 116 |
115 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 117 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
OLD | NEW |