Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginWbPassThrough.h

Issue 29331590: Issue #1484 - Make PassthroughAPP a pass-through again (Closed)
Patch Set: Created Dec. 22, 2015, 2:31 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginMimeFilterClient.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/plugin/PluginMimeFilterClient.cpp ('k') | src/plugin/PluginWbPassThrough.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld