| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 END_COM_MAP() | 50 END_COM_MAP() |
| 51 | 51 |
| 52 BEGIN_SERVICE_MAP(WBPassthruSink) | 52 BEGIN_SERVICE_MAP(WBPassthruSink) |
| 53 SERVICE_ENTRY(IID_IHttpNegotiate) | 53 SERVICE_ENTRY(IID_IHttpNegotiate) |
| 54 END_SERVICE_MAP() | 54 END_SERVICE_MAP() |
| 55 | 55 |
| 56 STDMETHODIMP BeginningTransaction( | 56 STDMETHODIMP BeginningTransaction( |
| 57 /* [in] */ LPCWSTR szURL, | 57 /* [in] */ LPCWSTR szURL, |
| 58 /* [in] */ LPCWSTR szHeaders, | 58 /* [in] */ LPCWSTR szHeaders, |
| 59 /* [in] */ DWORD dwReserved, | 59 /* [in] */ DWORD dwReserved, |
| 60 /* [out] */ LPWSTR *pszAdditionalHeaders); | 60 /* [out] */ LPWSTR* pszAdditionalHeaders); |
| 61 | 61 |
| 62 STDMETHODIMP OnResponse( | 62 STDMETHODIMP OnResponse( |
| 63 /* [in] */ DWORD dwResponseCode, | 63 /* [in] */ DWORD dwResponseCode, |
| 64 /* [in] */ LPCWSTR szResponseHeaders, | 64 /* [in] */ LPCWSTR szResponseHeaders, |
| 65 /* [in] */ LPCWSTR szRequestHeaders, | 65 /* [in] */ LPCWSTR szRequestHeaders, |
| 66 /* [out] */ LPWSTR *pszAdditionalRequestHeaders); | 66 /* [out] */ LPWSTR* pszAdditionalRequestHeaders); |
| 67 | 67 |
| 68 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, | 68 HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink* pOIProtSink, |
| 69 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved, | 69 IInternetBindInfo* pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved, |
| 70 IInternetProtocol* pTargetProtocol); | 70 IInternetProtocol* pTargetProtocol); |
| 71 | 71 |
| 72 HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead); | 72 HRESULT OnRead(void* pv, ULONG cb, ULONG* pcbRead); |
| 73 | 73 |
| 74 STDMETHODIMP ReportProgress( | 74 STDMETHODIMP ReportProgress( |
| 75 /* [in] */ ULONG ulStatusCode, | 75 /* [in] */ ULONG ulStatusCode, |
| 76 /* [in] */ LPCWSTR szStatusText); | 76 /* [in] */ LPCWSTR szStatusText); |
| 77 | 77 |
| 78 STDMETHODIMP ReportResult( | 78 STDMETHODIMP ReportResult( |
| 79 /* [in] */ HRESULT hrResult, | 79 /* [in] */ HRESULT hrResult, |
| 80 /* [in] */ DWORD dwError, | 80 /* [in] */ DWORD dwError, |
| 81 /* [in] */ LPCWSTR szResult); | 81 /* [in] */ LPCWSTR szResult); |
| 82 | 82 |
| 83 STDMETHODIMP Switch( | 83 STDMETHODIMP Switch( |
| 84 /* [in] */ PROTOCOLDATA *pProtocolData); | 84 /* [in] */ PROTOCOLDATA *pProtocolData); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class WBPassthru; | 87 class WbPassthroughProtocol; |
| 88 typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStar
tPolicy; | |
| 89 | 88 |
| 90 class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy> | 89 class WbPassthroughSinkStartPolicy |
| 90 : public PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassth
ruSink> |
| 91 { | 91 { |
| 92 typedef PassthroughAPP::CInternetProtocol<WBStartPolicy> BaseClass; | 92 typedef PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassthr
uSink> BaseClass; |
| 93 public: | 93 public: |
| 94 WBPassthru(); | 94 HRESULT OnStart(LPCWSTR szUrl, |
| 95 // IInternetProtocolRoot | 95 IInternetProtocolSink* pOIProtSink, IInternetBindInfo* pOIBindInfo, |
| 96 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, | 96 DWORD grfPI, HANDLE_PTR dwReserved, |
| 97 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override
; | 97 IInternetProtocol* pTargetProtocol); |
| 98 }; |
| 98 | 99 |
| 99 // IInternetProtocol | 100 /** |
| 100 STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULO
NG *pcbRead) override; | 101 * Implementation of "Protocol" interfaces |
| 102 */ |
| 103 class WbPassthroughProtocol |
| 104 : public PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> |
| 105 { |
| 106 typedef PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> BaseCl
ass; |
| 107 public: |
| 108 WbPassthroughProtocol() |
| 109 : m_shouldSupplyCustomContent(false) |
| 110 { |
| 111 } |
| 112 |
| 113 // derived from IInternetProtocolRoot |
| 114 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink* pOIProtSink, |
| 115 IInternetBindInfo* pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override
; |
| 116 |
| 117 // derived from IInternetProtocol |
| 118 STDMETHODIMP Read(/* [in, out] */ void* pv,/* [in] */ ULONG cb,/* [out] */ ULO
NG* pcbRead) override; |
| 101 | 119 |
| 102 bool m_shouldSupplyCustomContent; | 120 bool m_shouldSupplyCustomContent; |
| 103 }; | 121 }; |
| 122 |
| 123 typedef PassthroughAPP::CMetaFactory<PassthroughAPP::CComClassFactoryProtocol, W
bPassthroughProtocol> MetaFactory; |
| 124 |
| 125 |
| OLD | NEW |