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

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

Issue 5020125841326080: Issue 1669 - Report blocked object subrequests as failed, not as empty HTML (Closed)
Patch Set: Created Dec. 7, 2014, 11:55 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginWbPassThrough.h" 3 #include "PluginWbPassThrough.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #include "PluginFilter.h" 6 #include "PluginFilter.h"
7 #include "PluginSettings.h" 7 #include "PluginSettings.h"
8 #include "PluginClass.h" 8 #include "PluginClass.h"
9 #include "PluginSystem.h" 9 #include "PluginSystem.h"
10 #include <WinInet.h> 10 #include <WinInet.h>
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK; 356 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK;
357 } 357 }
358 358
359 STDMETHODIMP WBPassthruSink::ReportResult(/* [in] */ HRESULT hrResult, /* [in] * / DWORD dwError, /* [in] */ LPCWSTR szResult) 359 STDMETHODIMP WBPassthruSink::ReportResult(/* [in] */ HRESULT hrResult, /* [in] * / DWORD dwError, /* [in] */ LPCWSTR szResult)
360 { 360 {
361 if (m_blockedInTransaction) 361 if (m_blockedInTransaction)
362 { 362 {
363 // Don't notify the client about aborting of the operation, thus don't call BaseClass::ReportResult. 363 // Don't notify the client about aborting of the operation, thus don't call BaseClass::ReportResult.
364 // Current method is called by the original protocol implementation and we a re intercepting the 364 // Current method is called by the original protocol implementation and we a re intercepting the
365 // call here and eating it, we will call the proper ReportResult later by ou rself. 365 // call here and eating it, we will call the proper ReportResult later by ou rself.
366 return S_OK; 366 // NOTE: Feeding custom HTML to Flash, instead of original object subrequest
367 // doesn't have much sense. It also can manifest in unwanted result
368 // like video being blocked (See https://issues.adblockplus.org/ticket/1669)
369 // So we report blocked object subrequests as failed, not just empty HTML.
370 if (m_contentType != CFilter::contentTypeObjectSubrequest)
371 {
372 return S_OK;
373 }
367 } 374 }
368 return BaseClass::ReportResult(hrResult, dwError, szResult); 375 return BaseClass::ReportResult(hrResult, dwError, szResult);
369 } 376 }
370 377
371 378
372 WBPassthru::WBPassthru() 379 WBPassthru::WBPassthru()
373 : m_shouldSupplyCustomContent(false) 380 : m_shouldSupplyCustomContent(false)
374 { 381 {
375 } 382 }
376 383
377 STDMETHODIMP WBPassthru::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink , 384 STDMETHODIMP WBPassthru::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink ,
378 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) 385 IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
379 { 386 {
380 ATLASSERT(m_spInternetProtocol != 0); 387 ATLASSERT(m_spInternetProtocol != 0);
381 if (!m_spInternetProtocol) 388 if (!m_spInternetProtocol)
382 { 389 {
383 return E_UNEXPECTED; 390 return E_UNEXPECTED;
384 } 391 }
385 392
386 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne tProtocol); 393 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne tProtocol);
387 } 394 }
388 395
389 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o ut] */ ULONG *pcbRead) 396 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o ut] */ ULONG *pcbRead)
390 { 397 {
391 WBPassthruSink* pSink = GetSink(); 398 WBPassthruSink* pSink = GetSink();
392 return pSink->OnRead(pv, cb, pcbRead); 399 return pSink->OnRead(pv, cb, pcbRead);
393 } 400 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld