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: rebase only Created Dec. 22, 2015, 2:28 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
« no previous file with comments | « src/plugin/PluginWbPassThrough.h ('k') | src/plugin/passthroughapp/SinkPolicy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginWbPassThrough.cpp
===================================================================
--- a/src/plugin/PluginWbPassThrough.cpp
+++ b/src/plugin/PluginWbPassThrough.cpp
@@ -234,7 +234,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));
@@ -418,13 +418,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)
+ {
+ 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);
@@ -436,7 +447,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);
« no previous file with comments | « src/plugin/PluginWbPassThrough.h ('k') | src/plugin/passthroughapp/SinkPolicy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld