OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_FRAME_PROTOCOL_SINK_WRAP_H_ | 5 #ifndef CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ |
6 #define CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ | 6 #define CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ |
7 | 7 |
8 #include <exdisp.h> | 8 #include <exdisp.h> |
9 #include <urlmon.h> | 9 #include <urlmon.h> |
10 #include <atlbase.h> | 10 #include <atlbase.h> |
(...skipping 18 matching lines...) Expand all Loading... |
29 IInternetProtocol* this_object, LPCWSTR url, | 29 IInternetProtocol* this_object, LPCWSTR url, |
30 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, | 30 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, |
31 DWORD flags, HANDLE_PTR reserved); | 31 DWORD flags, HANDLE_PTR reserved); |
32 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_Read_Fn)( | 32 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_Read_Fn)( |
33 IInternetProtocol* this_object, void* buffer, ULONG size, | 33 IInternetProtocol* this_object, void* buffer, ULONG size, |
34 ULONG* size_read); | 34 ULONG* size_read); |
35 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_StartEx_Fn)( | 35 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_StartEx_Fn)( |
36 IInternetProtocolEx* this_object, IUri* uri, | 36 IInternetProtocolEx* this_object, IUri* uri, |
37 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, | 37 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, |
38 DWORD flags, HANDLE_PTR reserved); | 38 DWORD flags, HANDLE_PTR reserved); |
39 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocolRoot_Continue_Fn)( | 39 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_LockRequest_Fn)( |
40 IInternetProtocolRoot* me, PROTOCOLDATA* data); | 40 IInternetProtocol* this_object, DWORD options); |
| 41 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_UnlockRequest_Fn)( |
| 42 IInternetProtocol* this_object); |
41 | 43 |
42 | 44 |
43 enum RendererType { | 45 enum RendererType { |
44 UNDETERMINED, | 46 UNDETERMINED, |
45 CHROME, | 47 CHROME, |
46 OTHER | 48 OTHER |
47 }; | 49 }; |
48 | 50 |
49 class ProtData; | 51 class ProtData; |
50 | 52 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 125 |
124 RendererType renderer_type() { | 126 RendererType renderer_type() { |
125 return renderer_type_; | 127 return renderer_type_; |
126 } | 128 } |
127 | 129 |
128 // Valid only if renderer_type_ is CHROME. | 130 // Valid only if renderer_type_ is CHROME. |
129 const std::string& referrer() const { | 131 const std::string& referrer() const { |
130 return referrer_; | 132 return referrer_; |
131 } | 133 } |
132 | 134 |
| 135 bool is_attach_external_tab_request() const { |
| 136 return read_fun_ == NULL; |
| 137 } |
| 138 |
133 private: | 139 private: |
134 typedef std::map<IInternetProtocol*, ProtData*> ProtocolDataMap; | 140 typedef std::map<IInternetProtocol*, ProtData*> ProtocolDataMap; |
135 static ProtocolDataMap datamap_; | 141 static ProtocolDataMap datamap_; |
136 static Lock datamap_lock_; | 142 static Lock datamap_lock_; |
137 | 143 |
138 // Url we are retrieving. Used for IsOptInUrl() only. | 144 // Url we are retrieving. Used for IsOptInUrl() only. |
139 std::wstring url_; | 145 std::wstring url_; |
140 // HTTP "Referrer" header if we detect are going to switch. | 146 // HTTP "Referrer" header if we detect are going to switch. |
141 // We have to save and pass it to Chrome, so scripts can read it via DOM. | 147 // We have to save and pass it to Chrome, so scripts can read it via DOM. |
142 std::string referrer_; | 148 std::string referrer_; |
(...skipping 28 matching lines...) Expand all Loading... |
171 | 177 |
172 struct TransactionHooks { | 178 struct TransactionHooks { |
173 void InstallHooks(); | 179 void InstallHooks(); |
174 void RevertHooks(); | 180 void RevertHooks(); |
175 }; | 181 }; |
176 | 182 |
177 DECLSPEC_SELECTANY struct TransactionHooks g_trans_hooks; | 183 DECLSPEC_SELECTANY struct TransactionHooks g_trans_hooks; |
178 | 184 |
179 #endif // CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ | 185 #endif // CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ |
180 | 186 |
OLD | NEW |