LEFT | RIGHT |
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 WbPassthroughProtocol; | 87 class WbPassthroughProtocol; |
88 | 88 |
89 class WbPassthroughSinkStartPolicy | 89 class WbPassthroughSinkStartPolicy |
90 : public PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassth
ruSink> | 90 : public PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassth
ruSink> |
91 { | 91 { |
92 typedef PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassthr
uSink> BaseClass; | 92 typedef PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassthr
uSink> BaseClass; |
93 public: | 93 public: |
94 HRESULT OnStart(LPCWSTR szUrl, | 94 HRESULT OnStart(LPCWSTR szUrl, |
95 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, | 95 IInternetProtocolSink* pOIProtSink, IInternetBindInfo* pOIBindInfo, |
96 DWORD grfPI, HANDLE_PTR dwReserved, | 96 DWORD grfPI, HANDLE_PTR dwReserved, |
97 IInternetProtocol* pTargetProtocol); | 97 IInternetProtocol* pTargetProtocol); |
98 }; | 98 }; |
99 | 99 |
100 /** | 100 /** |
101 * Implementation of "Protocol" interfaces | 101 * Implementation of "Protocol" interfaces |
102 */ | 102 */ |
103 class WbPassthroughProtocol | 103 class WbPassthroughProtocol |
104 : public PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> | 104 : public PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> |
105 { | 105 { |
106 typedef PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> BaseCl
ass; | 106 typedef PassthroughAPP::CInternetProtocol<WbPassthroughSinkStartPolicy> BaseCl
ass; |
107 public: | 107 public: |
108 WbPassthroughProtocol() | 108 WbPassthroughProtocol() |
109 : m_shouldSupplyCustomContent(false) | 109 : m_shouldSupplyCustomContent(false) |
110 { | 110 { |
111 } | 111 } |
112 | 112 |
113 // derived from IInternetProtocolRoot | 113 // derived from IInternetProtocolRoot |
114 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, | 114 STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink* pOIProtSink, |
115 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override
; | 115 IInternetBindInfo* pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override
; |
116 | 116 |
117 // derived from IInternetProtocol | 117 // derived from IInternetProtocol |
118 STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULO
NG *pcbRead) override; | 118 STDMETHODIMP Read(/* [in, out] */ void* pv,/* [in] */ ULONG cb,/* [out] */ ULO
NG* pcbRead) override; |
119 | 119 |
120 bool m_shouldSupplyCustomContent; | 120 bool m_shouldSupplyCustomContent; |
121 }; | 121 }; |
122 | 122 |
123 typedef PassthroughAPP::CMetaFactory<PassthroughAPP::CComClassFactoryProtocol, W
bPassthroughProtocol> MetaFactory; | 123 typedef PassthroughAPP::CMetaFactory<PassthroughAPP::CComClassFactoryProtocol, W
bPassthroughProtocol> MetaFactory; |
124 | 124 |
125 | 125 |
LEFT | RIGHT |