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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 BufferedPeer(std::unique_ptr<content::RequestPeer> peer, | 56 BufferedPeer(std::unique_ptr<content::RequestPeer> peer, |
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 std::string& security_info, | |
67 const base::TimeTicks& completion_time, | 66 const base::TimeTicks& completion_time, |
68 int64_t total_transfer_size) override; | 67 int64_t total_transfer_size) override; |
69 | 68 |
70 protected: | 69 protected: |
71 // Invoked when the entire request has been processed before the data is sent | 70 // Invoked when the entire request has been processed before the data is sent |
72 // to the original peer, giving an opportunity to subclasses to process the | 71 // to the original peer, giving an opportunity to subclasses to process the |
73 // data in data_. If this method returns true, the data is fed to the | 72 // data in data_. If this method returns true, the data is fed to the |
74 // original peer, if it returns false, an error is sent instead. | 73 // original peer, if it returns false, an error is sent instead. |
75 virtual bool DataReady() = 0; | 74 virtual bool DataReady() = 0; |
76 | 75 |
(...skipping 18 matching lines...) Expand all Loading... |
95 const std::string& mime_type, | 94 const std::string& mime_type, |
96 const std::string& data); | 95 const std::string& data); |
97 ~ReplaceContentPeer() override; | 96 ~ReplaceContentPeer() override; |
98 | 97 |
99 // content::RequestPeer Implementation. | 98 // content::RequestPeer Implementation. |
100 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; | 99 void OnReceivedResponse(const content::ResourceResponseInfo& info) override; |
101 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; | 100 void OnReceivedData(std::unique_ptr<ReceivedData> data) override; |
102 void OnCompletedRequest(int error_code, | 101 void OnCompletedRequest(int error_code, |
103 bool was_ignored_by_handler, | 102 bool was_ignored_by_handler, |
104 bool stale_copy_in_cache, | 103 bool stale_copy_in_cache, |
105 const std::string& security_info, | |
106 const base::TimeTicks& completion_time, | 104 const base::TimeTicks& completion_time, |
107 int64_t total_transfer_size) override; | 105 int64_t total_transfer_size) override; |
108 | 106 |
109 private: | 107 private: |
110 content::ResourceResponseInfo response_info_; | 108 content::ResourceResponseInfo response_info_; |
111 std::string mime_type_; | 109 std::string mime_type_; |
112 std::string data_; | 110 std::string data_; |
113 | 111 |
114 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); | 112 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); |
115 }; | 113 }; |
116 | 114 |
117 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 115 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
OLD | NEW |