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