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

Delta Between Two Patch Sets: src/plugin/PluginWbPassThrough.cpp

Issue 5020125841326080: Issue 1669 - Report blocked object subrequests as failed, not as empty HTML (Closed)
Left Patch Set: Moved to WBPassthruSink::BeginningTransaction. Renamed the m_blockedInTransaction. Created Dec. 9, 2014, 10:16 a.m.
Right Patch Set: Added comment Created Dec. 9, 2014, 10:27 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginWbPassThrough.h ('k') | src/plugin/SinkPolicy.inl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 m_contentType = CFilter::EContentType::contentTypeObjectSubrequest; 325 m_contentType = CFilter::EContentType::contentTypeObjectSubrequest;
326 } 326 }
327 327
328 if (pszAdditionalHeaders && *pszAdditionalHeaders && IsXmlHttpRequest(*pszAddi tionalHeaders)) 328 if (pszAdditionalHeaders && *pszAdditionalHeaders && IsXmlHttpRequest(*pszAddi tionalHeaders))
329 { 329 {
330 m_contentType = CFilter::EContentType::contentTypeXmlHttpRequest; 330 m_contentType = CFilter::EContentType::contentTypeXmlHttpRequest;
331 } 331 }
332 332
333 if (client->ShouldBlock(szURL, m_contentType, m_boundDomain, /*debug flag but must be set*/true)) 333 if (client->ShouldBlock(szURL, m_contentType, m_boundDomain, /*debug flag but must be set*/true))
334 { 334 {
335 // NOTE: Feeding custom HTML to Flash, instead of original object subrequest
336 // doesn't have much sense. It also can manifest in unwanted result
337 // like video being blocked (See https://issues.adblockplus.org/ticket/1669)
338 // So we report blocked object subrequests as failed, not just empty HTML.
335 m_isCustomResponse = m_contentType != CFilter::contentTypeObjectSubrequest; 339 m_isCustomResponse = m_contentType != CFilter::contentTypeObjectSubrequest;
336 return E_ABORT; 340 return E_ABORT;
337 } 341 }
338 return nativeHr; 342 return nativeHr;
339 } 343 }
340 344
341 STDMETHODIMP WBPassthruSink::OnResponse(DWORD dwResponseCode, LPCWSTR szResponse Headers, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders) 345 STDMETHODIMP WBPassthruSink::OnResponse(DWORD dwResponseCode, LPCWSTR szResponse Headers, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders)
342 { 346 {
343 if (pszAdditionalRequestHeaders) 347 if (pszAdditionalRequestHeaders)
344 { 348 {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 388 }
385 389
386 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne tProtocol); 390 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne tProtocol);
387 } 391 }
388 392
389 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o ut] */ ULONG *pcbRead) 393 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o ut] */ ULONG *pcbRead)
390 { 394 {
391 WBPassthruSink* pSink = GetSink(); 395 WBPassthruSink* pSink = GetSink();
392 return pSink->OnRead(pv, cb, pcbRead); 396 return pSink->OnRead(pv, cb, pcbRead);
393 } 397 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld