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

Unified Diff: src/plugin/PluginWbPassThrough.h

Issue 5316782940225536: Issue 1557 - Update to the recent libadblockplus to reduce additional updates in the logic later. (Closed)
Patch Set: link addon with libadblockplus Created Jan. 29, 2015, 4:05 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginWbPassThrough.h
diff --git a/src/plugin/PluginWbPassThrough.h b/src/plugin/PluginWbPassThrough.h
index c3ae80bfed2c16ddca68d26479d4df2d440c7d0c..c26a77d557f8f3a02e64954a2a7d5bf673c1fb47 100644
--- a/src/plugin/PluginWbPassThrough.h
+++ b/src/plugin/PluginWbPassThrough.h
@@ -15,85 +15,86 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-#pragma once
-#include <cstdint>
-#include "ProtocolCF.h"
-#include "ProtocolImpl.h"
-#define IE_MAX_URL_LENGTH 2048
-
-class WBPassthruSink :
- public PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComMultiThreadModel>,
- public IHttpNegotiate
-{
- typedef PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComMultiThreadModel> BaseClass;
-
-public:
- WBPassthruSink();
-
- uint64_t m_currentPositionOfSentPage;
- CComPtr<IInternetProtocol> m_pTargetProtocol;
- int m_contentType;
- std::wstring m_boundDomain;
- bool m_isCustomResponse;
-
- int GetContentTypeFromMimeType(const CString& mimeType);
- int GetContentTypeFromURL(const std::wstring& src);
- int GetContentType(const CString& mimeType, const std::wstring& domain, const std::wstring& src);
- bool IsFlashRequest(const wchar_t* const* additionalHeaders);
-public:
- BEGIN_COM_MAP(WBPassthruSink)
- COM_INTERFACE_ENTRY(IHttpNegotiate)
- COM_INTERFACE_ENTRY_CHAIN(BaseClass)
- END_COM_MAP()
-
- BEGIN_SERVICE_MAP(WBPassthruSink)
- SERVICE_ENTRY(IID_IHttpNegotiate)
- END_SERVICE_MAP()
-
- STDMETHODIMP BeginningTransaction(
- /* [in] */ LPCWSTR szURL,
- /* [in] */ LPCWSTR szHeaders,
- /* [in] */ DWORD dwReserved,
- /* [out] */ LPWSTR *pszAdditionalHeaders);
-
- STDMETHODIMP OnResponse(
- /* [in] */ DWORD dwResponseCode,
- /* [in] */ LPCWSTR szResponseHeaders,
- /* [in] */ LPCWSTR szRequestHeaders,
- /* [out] */ LPWSTR *pszAdditionalRequestHeaders);
-
- HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
- IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved,
- IInternetProtocol* pTargetProtocol, bool& handled);
- HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead);
-
- STDMETHODIMP ReportProgress(
- /* [in] */ ULONG ulStatusCode,
- /* [in] */ LPCWSTR szStatusText);
-
- STDMETHODIMP ReportResult(
- /* [in] */ HRESULT hrResult,
- /* [in] */ DWORD dwError,
- /* [in] */ LPCWSTR szResult);
-
- STDMETHODIMP Switch(
- /* [in] */ PROTOCOLDATA *pProtocolData);
-};
-
-class WBPassthru;
-typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStartPolicy;
-
-class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy>
-{
- typedef PassthroughAPP::CInternetProtocol<WBStartPolicy> BaseClass;
-public:
- WBPassthru();
- // IInternetProtocolRoot
- STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
- IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override;
-
- //IInternetProtocol
- STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) override;
-
- bool m_shouldSupplyCustomContent;
-};
+#pragma once
+#include <cstdint>
+#include <AdblockPlus/FilterEngine.h>
+#include "ProtocolCF.h"
+#include "ProtocolImpl.h"
+#define IE_MAX_URL_LENGTH 2048
+
+class WBPassthruSink :
+ public PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComMultiThreadModel>,
+ public IHttpNegotiate
+{
+ typedef PassthroughAPP::CInternetProtocolSinkWithSP<WBPassthruSink, CComMultiThreadModel> BaseClass;
+
+public:
+ WBPassthruSink();
+
+ uint64_t m_currentPositionOfSentPage;
+ CComPtr<IInternetProtocol> m_pTargetProtocol;
+ AdblockPlus::FilterEngine::ContentType m_contentType;
+ std::wstring m_boundDomain;
+ bool m_isCustomResponse;
+
+ AdblockPlus::FilterEngine::ContentType GetContentTypeFromMimeType(const CString& mimeType);
+ AdblockPlus::FilterEngine::ContentType GetContentTypeFromURL(const std::wstring& src);
+ AdblockPlus::FilterEngine::ContentType GetContentType(const CString& mimeType, const std::wstring& domain, const std::wstring& src);
+ bool IsFlashRequest(const wchar_t* const* additionalHeaders);
+public:
+ BEGIN_COM_MAP(WBPassthruSink)
+ COM_INTERFACE_ENTRY(IHttpNegotiate)
+ COM_INTERFACE_ENTRY_CHAIN(BaseClass)
+ END_COM_MAP()
+
+ BEGIN_SERVICE_MAP(WBPassthruSink)
+ SERVICE_ENTRY(IID_IHttpNegotiate)
+ END_SERVICE_MAP()
+
+ STDMETHODIMP BeginningTransaction(
+ /* [in] */ LPCWSTR szURL,
+ /* [in] */ LPCWSTR szHeaders,
+ /* [in] */ DWORD dwReserved,
+ /* [out] */ LPWSTR *pszAdditionalHeaders);
+
+ STDMETHODIMP OnResponse(
+ /* [in] */ DWORD dwResponseCode,
+ /* [in] */ LPCWSTR szResponseHeaders,
+ /* [in] */ LPCWSTR szRequestHeaders,
+ /* [out] */ LPWSTR *pszAdditionalRequestHeaders);
+
+ HRESULT OnStart(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
+ IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved,
+ IInternetProtocol* pTargetProtocol, bool& handled);
+ HRESULT OnRead(void *pv, ULONG cb, ULONG* pcbRead);
+
+ STDMETHODIMP ReportProgress(
+ /* [in] */ ULONG ulStatusCode,
+ /* [in] */ LPCWSTR szStatusText);
+
+ STDMETHODIMP ReportResult(
+ /* [in] */ HRESULT hrResult,
+ /* [in] */ DWORD dwError,
+ /* [in] */ LPCWSTR szResult);
+
+ STDMETHODIMP Switch(
+ /* [in] */ PROTOCOLDATA *pProtocolData);
+};
+
+class WBPassthru;
+typedef PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink> WBStartPolicy;
+
+class WBPassthru : public PassthroughAPP::CInternetProtocol<WBStartPolicy>
+{
+ typedef PassthroughAPP::CInternetProtocol<WBStartPolicy> BaseClass;
+public:
+ WBPassthru();
+ // IInternetProtocolRoot
+ STDMETHODIMP Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
+ IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) override;
+
+ //IInternetProtocol
+ STDMETHODIMP Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) override;
+
+ bool m_shouldSupplyCustomContent;
+};

Powered by Google App Engine
This is Rietveld