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

Unified Diff: src/plugin/PluginWbPassThrough.cpp

Issue 29331590: Issue #1484 - Make PassthroughAPP a pass-through again (Closed)
Patch Set: Created Nov. 30, 2015, 1:48 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.cpp
===================================================================
--- a/src/plugin/PluginWbPassThrough.cpp
+++ b/src/plugin/PluginWbPassThrough.cpp
@@ -233,7 +233,7 @@
}
*pcbRead = 0;
- if (PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink>::GetProtocol(this)->m_shouldSupplyCustomContent)
+ if (PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassthruSink>::GetProtocol(this)->m_shouldSupplyCustomContent)
{
ULONG blockedByABPPageSize = static_cast<ULONG>(g_blockedByABPPage.size());
auto positionGrow = std::min<ULONG>(cb, static_cast<ULONG>(blockedByABPPageSize - m_currentPositionOfSentPage));
@@ -417,13 +417,24 @@
return BaseClass::ReportResult(hrResult, dwError, szResult);
}
-
-WBPassthru::WBPassthru()
- : m_shouldSupplyCustomContent(false)
+HRESULT WbPassthroughSinkStartPolicy::OnStart(LPCWSTR szUrl,
+ IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
+ DWORD grfPI, HANDLE_PTR dwReserved,
+ IInternetProtocol* pTargetProtocol)
{
+ HRESULT hr = BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, pTargetProtocol);
+ WBPassthruSink* pSink = GetSink();
+ if (hr == E_ABORT && pSink->m_isCustomResponse)
Oleksandr 2015/12/16 13:33:30 I am actually not even sure we need this clause at
+ {
+ GetProtocol(pSink)->m_shouldSupplyCustomContent = true;
+ pSink->m_spInternetProtocolSink->ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE, L"text/html");
+ pSink->m_spInternetProtocolSink->ReportData(BSCF_FIRSTDATANOTIFICATION, 0, static_cast<ULONG>(g_blockedByABPPage.size()));
+ return S_OK;
+ }
+ return hr;
}
-STDMETHODIMP WBPassthru::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
+STDMETHODIMP WbPassthroughProtocol::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
{
ATLASSERT(m_spInternetProtocol != 0);
@@ -435,7 +446,7 @@
return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInternetProtocol);
}
-STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead)
+STDMETHODIMP WbPassthroughProtocol::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead)
{
WBPassthruSink* pSink = GetSink();
return pSink->OnRead(pv, cb, pcbRead);

Powered by Google App Engine
This is Rietveld