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_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> |
11 #include <atlcom.h> | 11 #include <atlcom.h> |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/win/scoped_comptr.h" | 18 #include "base/win/scoped_comptr.h" |
19 #include "base/win/scoped_bstr.h" | 19 #include "base/win/scoped_bstr.h" |
20 #include "googleurl/src/gurl.h" | |
21 #include "chrome_frame/chrome_frame_delegate.h" | 20 #include "chrome_frame/chrome_frame_delegate.h" |
22 #include "chrome_frame/http_negotiate.h" | 21 #include "chrome_frame/http_negotiate.h" |
23 #include "chrome_frame/ie8_types.h" | 22 #include "chrome_frame/ie8_types.h" |
24 #include "chrome_frame/utils.h" | 23 #include "chrome_frame/utils.h" |
25 #include "chrome_frame/vtable_patch_manager.h" | 24 #include "chrome_frame/vtable_patch_manager.h" |
26 | 25 |
27 // Typedefs for IInternetProtocol and related methods that we patch. | 26 // Typedefs for IInternetProtocol and related methods that we patch. |
28 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_Start_Fn)( | 27 typedef HRESULT (STDMETHODCALLTYPE* InternetProtocol_Start_Fn)( |
29 IInternetProtocol* this_object, LPCWSTR url, | 28 IInternetProtocol* this_object, LPCWSTR url, |
30 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, | 29 IInternetProtocolSink* prot_sink, IInternetBindInfo* bind_info, |
(...skipping 24 matching lines...) Expand all Loading... |
55 // a different mime type in that case. | 54 // a different mime type in that case. |
56 // | 55 // |
57 // We implement several documented interfaces | 56 // We implement several documented interfaces |
58 // supported by the original sink provided by urlmon. There are a few | 57 // supported by the original sink provided by urlmon. There are a few |
59 // undocumented interfaces that we have chosen not to implement | 58 // undocumented interfaces that we have chosen not to implement |
60 // but delegate simply the QI. | 59 // but delegate simply the QI. |
61 class ProtocolSinkWrap | 60 class ProtocolSinkWrap |
62 : public CComObjectRootEx<CComMultiThreadModel>, | 61 : public CComObjectRootEx<CComMultiThreadModel>, |
63 public IInternetProtocolSink { | 62 public IInternetProtocolSink { |
64 public: | 63 public: |
65 | |
66 BEGIN_COM_MAP(ProtocolSinkWrap) | 64 BEGIN_COM_MAP(ProtocolSinkWrap) |
67 COM_INTERFACE_ENTRY(IInternetProtocolSink) | 65 COM_INTERFACE_ENTRY(IInternetProtocolSink) |
68 COM_INTERFACE_BLIND_DELEGATE() | 66 COM_INTERFACE_BLIND_DELEGATE() |
69 END_COM_MAP() | 67 END_COM_MAP() |
70 | 68 |
71 static base::win::ScopedComPtr<IInternetProtocolSink> CreateNewSink( | 69 static base::win::ScopedComPtr<IInternetProtocolSink> CreateNewSink( |
72 IInternetProtocolSink* sink, ProtData* prot_data); | 70 IInternetProtocolSink* sink, ProtData* prot_data); |
73 | 71 |
74 // Enables or disables activation of Chrome Frame via the X-UA-Compatible | 72 // Enables or disables activation of Chrome Frame via the X-UA-Compatible |
75 // header or meta tag. The tag/header is respected by default. | 73 // header or meta tag. The tag/header is respected by default. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 }; | 175 }; |
178 | 176 |
179 struct TransactionHooks { | 177 struct TransactionHooks { |
180 void InstallHooks(); | 178 void InstallHooks(); |
181 void RevertHooks(); | 179 void RevertHooks(); |
182 }; | 180 }; |
183 | 181 |
184 DECLSPEC_SELECTANY struct TransactionHooks g_trans_hooks; | 182 DECLSPEC_SELECTANY struct TransactionHooks g_trans_hooks; |
185 | 183 |
186 #endif // CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ | 184 #endif // CHROME_FRAME_PROTOCOL_SINK_WRAP_H_ |
OLD | NEW |