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

Unified Diff: src/plugin/passthroughapp/SinkPolicy.inl

Issue 29332980: Issue #1484 - Use the currently distributed version of PassthroughAPP unaltered
Patch Set: use OnStartEx() instead of OnStart() Created Dec. 23, 2015, 3:18 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/passthroughapp/SinkPolicy.inl
===================================================================
--- a/src/plugin/passthroughapp/SinkPolicy.inl
+++ b/src/plugin/passthroughapp/SinkPolicy.inl
@@ -1,20 +1,3 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
#ifndef PASSTHROUGHAPP_SINKPOLICY_INL
#define PASSTHROUGHAPP_SINKPOLICY_INL
@@ -41,6 +24,15 @@
grfPI, dwReserved);
}
+inline HRESULT NoSinkStartPolicy::OnStartEx(IUri* pUri,
+ IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
+ DWORD grfPI, HANDLE_PTR dwReserved,
+ IInternetProtocolEx* pTargetProtocol) const
+{
+ ATLASSERT(pTargetProtocol != 0);
+ return pTargetProtocol->StartEx(pUri, pOIProtSink, pOIBindInfo,
+ grfPI, dwReserved);
+}
// ===== CComObjectSharedRef =====
@@ -387,21 +379,57 @@
CComPtr<IInternetBindInfo> spBindInfo;
if (SUCCEEDED(hr))
{
- hr = pSink->QueryInterface(IID_IInternetProtocolSink, reinterpret_cast<void**>(&spSink));
+ hr = pSink->QueryInterface(IID_IInternetProtocolSink,
+ reinterpret_cast<void**>(&spSink));
ATLASSERT(SUCCEEDED(hr) && spSink != 0);
}
if (SUCCEEDED(hr))
{
- hr = pSink->QueryInterface(IID_IInternetBindInfo, reinterpret_cast<void**>(&spBindInfo));
+ hr = pSink->QueryInterface(IID_IInternetBindInfo,
+ reinterpret_cast<void**>(&spBindInfo));
ATLASSERT(SUCCEEDED(hr) && spBindInfo != 0);
}
if (SUCCEEDED(hr))
{
- hr = pTargetProtocol->Start(szUrl, spSink, spBindInfo, grfPI, dwReserved);
+ hr = pTargetProtocol->Start(szUrl, spSink, spBindInfo, grfPI,
+ dwReserved);
}
return hr;
}
+template <class Protocol, class Sink>
+inline HRESULT CustomSinkStartPolicy<Protocol, Sink>::OnStartEx(IUri* pUri,
+ IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
+ DWORD grfPI, HANDLE_PTR dwReserved,
+ IInternetProtocolEx* pTargetProtocol) const
+{
+ ATLASSERT(pTargetProtocol != 0);
+
+ Sink* pSink = GetSink(static_cast<const Protocol*>(this));
+ HRESULT hr = pSink->OnStartEx(pUri, pOIProtSink, pOIBindInfo, grfPI,
+ dwReserved, pTargetProtocol);
+
+ CComPtr<IInternetProtocolSink> spSink;
+ CComPtr<IInternetBindInfo> spBindInfo;
+ if (SUCCEEDED(hr))
+ {
+ hr = pSink->QueryInterface(IID_IInternetProtocolSink,
+ reinterpret_cast<void**>(&spSink));
+ ATLASSERT(SUCCEEDED(hr) && spSink != 0);
+ }
+ if (SUCCEEDED(hr))
+ {
+ hr = pSink->QueryInterface(IID_IInternetBindInfo,
+ reinterpret_cast<void**>(&spBindInfo));
+ ATLASSERT(SUCCEEDED(hr) && spBindInfo != 0);
+ }
+ if (SUCCEEDED(hr))
+ {
+ hr = pTargetProtocol->StartEx(pUri, spSink, spBindInfo, grfPI,
+ dwReserved);
+ }
+ return hr;
+}
template <class Protocol, class Sink>
inline Sink* CustomSinkStartPolicy<Protocol, Sink>::GetSink(
@@ -425,4 +453,4 @@
} // end namespace PassthroughAPP
-#endif // PASSTHROUGHAPP_SINKPOLICY_INL
+#endif // PASSTHROUGHAPP_SINKPOLICY_INL

Powered by Google App Engine
This is Rietveld