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 "content/public/child/request_peer.h" | 8 #include "content/public/child/request_peer.h" |
9 #include "content/public/common/resource_response_info.h" | 9 #include "content/public/common/resource_response_info.h" |
10 #include "webkit/common/resource_type.h" | 10 #include "content/public/common/resource_type.h" |
11 | 11 |
12 // The SecurityFilterPeer is a proxy to a | 12 // The SecurityFilterPeer is a proxy to a |
13 // content::RequestPeer instance. It is used to pre-process | 13 // content::RequestPeer instance. It is used to pre-process |
14 // unsafe resources (such as mixed-content resource). | 14 // unsafe resources (such as mixed-content resource). |
15 // Call the factory method CreateSecurityFilterPeer() to obtain an instance of | 15 // Call the factory method CreateSecurityFilterPeer() to obtain an instance of |
16 // SecurityFilterPeer based on the original Peer. | 16 // SecurityFilterPeer based on the original Peer. |
17 // NOTE: subclasses should insure they delete themselves at the end of the | 17 // NOTE: subclasses should insure they delete themselves at the end of the |
18 // OnReceiveComplete call. | 18 // OnReceiveComplete call. |
19 class SecurityFilterPeer : public content::RequestPeer { | 19 class SecurityFilterPeer : public content::RequestPeer { |
20 public: | 20 public: |
21 virtual ~SecurityFilterPeer(); | 21 virtual ~SecurityFilterPeer(); |
22 | 22 |
23 static SecurityFilterPeer* CreateSecurityFilterPeerForDeniedRequest( | 23 static SecurityFilterPeer* CreateSecurityFilterPeerForDeniedRequest( |
24 ResourceType::Type resource_type, | 24 content::ResourceType::Type resource_type, |
25 content::RequestPeer* peer, | 25 content::RequestPeer* peer, |
26 int os_error); | 26 int os_error); |
27 | 27 |
28 static SecurityFilterPeer* CreateSecurityFilterPeerForFrame( | 28 static SecurityFilterPeer* CreateSecurityFilterPeerForFrame( |
29 content::RequestPeer* peer, | 29 content::RequestPeer* peer, |
30 int os_error); | 30 int os_error); |
31 | 31 |
32 // content::RequestPeer methods. | 32 // content::RequestPeer methods. |
33 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; | 33 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
34 virtual bool OnReceivedRedirect( | 34 virtual bool OnReceivedRedirect( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 private: | 124 private: |
125 content::ResourceResponseInfo response_info_; | 125 content::ResourceResponseInfo response_info_; |
126 std::string mime_type_; | 126 std::string mime_type_; |
127 std::string data_; | 127 std::string data_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); | 129 DISALLOW_COPY_AND_ASSIGN(ReplaceContentPeer); |
130 }; | 130 }; |
131 | 131 |
132 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ | 132 #endif // CHROME_RENDERER_SECURITY_FILTER_PEER_H_ |
OLD | NEW |