OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_FRAME_HTTP_NEGOTIATE_H_ |
| 6 #define CHROME_FRAME_HTTP_NEGOTIATE_H_ |
| 7 |
| 8 #include <urlmon.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 |
| 12 // Typedefs for IHttpNegotiate methods. |
| 13 typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_BeginningTransaction_Fn)( |
| 14 IHttpNegotiate* me, LPCWSTR url, LPCWSTR headers, DWORD reserved, |
| 15 LPWSTR* additional_headers); |
| 16 typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_OnResponse_Fn)( |
| 17 IHttpNegotiate* me, DWORD response_code, LPCWSTR response_header, |
| 18 LPCWSTR request_header, LPWSTR* additional_request_headers); |
| 19 |
| 20 // Patches methods of urlmon's IHttpNegotiate implementation for the purposes |
| 21 // of adding to the http user agent header. |
| 22 class HttpNegotiatePatch { |
| 23 // class is not to be instantiated atm. |
| 24 HttpNegotiatePatch(); |
| 25 ~HttpNegotiatePatch(); |
| 26 |
| 27 public: |
| 28 static bool Initialize(); |
| 29 static void Uninitialize(); |
| 30 |
| 31 static STDMETHODIMP BeginningTransaction( |
| 32 IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me, |
| 33 LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers); |
| 34 |
| 35 static STDMETHODIMP OnResponse( |
| 36 IHttpNegotiate_OnResponse_Fn original, IHttpNegotiate* me, |
| 37 DWORD response_code, LPCWSTR response_header, LPCWSTR request_header, |
| 38 LPWSTR* additional_request_headers); |
| 39 |
| 40 protected: |
| 41 static HRESULT PatchHttpNegotiate(IUnknown* to_patch); |
| 42 |
| 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(HttpNegotiatePatch); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_FRAME_HTTP_NEGOTIATE_H_ |
OLD | NEW |