| 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 "webkit/child/resource_loader_bridge.h" | 8 #include "webkit/child/resource_loader_bridge.h" |
| 9 | 9 |
| 10 // The SecurityFilterPeer is a proxy to a | 10 // The SecurityFilterPeer is a proxy to a |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 GURL* new_first_party_for_cookies) OVERRIDE; | 36 GURL* new_first_party_for_cookies) OVERRIDE; |
| 37 virtual void OnReceivedResponse( | 37 virtual void OnReceivedResponse( |
| 38 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; | 38 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; |
| 39 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE {} | 39 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE {} |
| 40 virtual void OnReceivedData(const char* data, | 40 virtual void OnReceivedData(const char* data, |
| 41 int data_length, | 41 int data_length, |
| 42 int encoded_data_length) OVERRIDE; | 42 int encoded_data_length) OVERRIDE; |
| 43 virtual void OnCompletedRequest( | 43 virtual void OnCompletedRequest( |
| 44 int error_code, | 44 int error_code, |
| 45 bool was_ignored_by_handler, | 45 bool was_ignored_by_handler, |
| 46 bool stale_copy_in_cache, |
| 46 const std::string& security_info, | 47 const std::string& security_info, |
| 47 const base::TimeTicks& completion_time) OVERRIDE; | 48 const base::TimeTicks& completion_time) OVERRIDE; |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 SecurityFilterPeer(webkit_glue::ResourceLoaderBridge* resource_loader_bridge, | 51 SecurityFilterPeer(webkit_glue::ResourceLoaderBridge* resource_loader_bridge, |
| 51 webkit_glue::ResourceLoaderBridge::Peer* peer); | 52 webkit_glue::ResourceLoaderBridge::Peer* peer); |
| 52 | 53 |
| 53 webkit_glue::ResourceLoaderBridge::Peer* original_peer_; | 54 webkit_glue::ResourceLoaderBridge::Peer* original_peer_; |
| 54 webkit_glue::ResourceLoaderBridge* resource_loader_bridge_; | 55 webkit_glue::ResourceLoaderBridge* resource_loader_bridge_; |
| 55 | 56 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 // ResourceLoaderBridge::Peer Implementation. | 70 // ResourceLoaderBridge::Peer Implementation. |
| 70 virtual void OnReceivedResponse( | 71 virtual void OnReceivedResponse( |
| 71 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; | 72 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; |
| 72 virtual void OnReceivedData(const char* data, | 73 virtual void OnReceivedData(const char* data, |
| 73 int data_length, | 74 int data_length, |
| 74 int encoded_data_length) OVERRIDE; | 75 int encoded_data_length) OVERRIDE; |
| 75 virtual void OnCompletedRequest( | 76 virtual void OnCompletedRequest( |
| 76 int error_code, | 77 int error_code, |
| 77 bool was_ignored_by_handler, | 78 bool was_ignored_by_handler, |
| 79 bool stale_copy_in_cache, |
| 78 const std::string& security_info, | 80 const std::string& security_info, |
| 79 const base::TimeTicks& completion_time) OVERRIDE; | 81 const base::TimeTicks& completion_time) OVERRIDE; |
| 80 | 82 |
| 81 protected: | 83 protected: |
| 82 // Invoked when the entire request has been processed before the data is sent | 84 // Invoked when the entire request has been processed before the data is sent |
| 83 // to the original peer, giving an opportunity to subclasses to process the | 85 // to the original peer, giving an opportunity to subclasses to process the |
| 84 // data in data_. If this method returns true, the data is fed to the | 86 // data in data_. If this method returns true, the data is fed to the |
| 85 // original peer, if it returns false, an error is sent instead. | 87 // original peer, if it returns false, an error is sent instead. |
| 86 virtual bool DataReady() = 0; | 88 virtual bool DataReady() = 0; |
| 87 | 89 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 112 | 114 |
| 113 // ResourceLoaderBridge::Peer Implementation. | 115 // ResourceLoaderBridge::Peer Implementation. |
| 114 virtual void OnReceivedResponse( | 116 virtual void OnReceivedResponse( |
| 115 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; | 117 const webkit_glue::ResourceResponseInfo& info) OVERRIDE; |
| 116 virtual void OnReceivedData(const char* data, | 118 virtual void OnReceivedData(const char* data, |
| 117 int data_length, | 119 int data_length, |
| 118 int encoded_data_length) OVERRIDE; | 120 int encoded_data_length) OVERRIDE; |
| 119 virtual void OnCompletedRequest( | 121 virtual void OnCompletedRequest( |
| 120 int error_code, | 122 int error_code, |
| 121 bool was_ignored_by_handler, | 123 bool was_ignored_by_handler, |
| 124 bool stale_copy_in_cache, |
| 122 const std::string& security_info, | 125 const std::string& security_info, |
| 123 const base::TimeTicks& completion_time) OVERRIDE; | 126 const base::TimeTicks& completion_time) OVERRIDE; |
| 124 | 127 |
| 125 private: | 128 private: |
| 126 webkit_glue::ResourceResponseInfo response_info_; | 129 webkit_glue::ResourceResponseInfo response_info_; |
| 127 std::string mime_type_; | 130 std::string mime_type_; |
| 128 std::string data_; | 131 std::string data_; |
| 129 | 132 |
| 130 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); | 133 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 136 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
| OLD | NEW |