| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 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 #ifdef SUPPORT_FILTER | 6 #ifdef SUPPORT_FILTER |
| 7 #include "PluginFilter.h" | 7 #include "PluginFilter.h" |
| 8 #endif | 8 #endif |
| 9 #include "PluginSettings.h" | 9 #include "PluginSettings.h" |
| 10 #include "PluginClass.h" | 10 #include "PluginClass.h" |
| 11 #include "PluginSystem.h" | 11 #include "PluginSystem.h" |
| 12 | 12 #include "../shared/IE_version.h" |
| 13 #include "wtypes.h" | 13 #include "wtypes.h" |
| 14 | 14 |
| 15 EXTERN_C IMAGE_DOS_HEADER __ImageBase; | 15 EXTERN_C IMAGE_DOS_HEADER __ImageBase; |
| 16 | 16 |
| 17 | 17 |
| 18 | 18 |
| 19 int WBPassthruSink::GetContentTypeFromMimeType(CString mimeType) | 19 int WBPassthruSink::GetContentTypeFromMimeType(CString mimeType) |
| 20 { | 20 { |
| 21 if (mimeType.Find(L"image/") >= 0) | 21 if (mimeType.Find(L"image/") >= 0) |
| 22 { | 22 { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 { | 89 { |
| 90 return CFilter::contentTypeAny & ~CFilter::contentTypeSubdocument; | 90 return CFilter::contentTypeAny & ~CFilter::contentTypeSubdocument; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } | 93 } |
| 94 | 94 |
| 95 int WBPassthruSink::GetContentType(CString mimeType, CString domain, CString src ) | 95 int WBPassthruSink::GetContentType(CString mimeType, CString domain, CString src ) |
| 96 { | 96 { |
| 97 // No referer or mime type | 97 // No referer or mime type |
| 98 // BINDSTRING_XDR_ORIGIN works only for IE v8+ | 98 // BINDSTRING_XDR_ORIGIN works only for IE v8+ |
| 99 if (mimeType.IsEmpty() && domain.IsEmpty() && CPluginClient::GetInstance()->Ge tIEVersion() >= 8) | 99 if (mimeType.IsEmpty() && domain.IsEmpty() && AdblockPlus::IE::installed_major _version() >= 8) |
|
sergei
2014/07/28 11:46:27
Just wonder, what happens if we throw an exception
Eric
2014/07/29 12:42:25
As of today, the exception will propagate up throu
sergei
2014/07/29 14:45:56
I cannot say, that I'm happy having such call here
Eric
2014/07/29 15:17:22
How was it clear that the previous code didn't thr
| |
| 100 { | 100 { |
| 101 return CFilter::contentTypeXmlHttpRequest; | 101 return CFilter::contentTypeXmlHttpRequest; |
| 102 } | 102 } |
| 103 int contentType = GetContentTypeFromMimeType(mimeType); | 103 int contentType = GetContentTypeFromMimeType(mimeType); |
| 104 if (contentType == CFilter::contentTypeAny) | 104 if (contentType == CFilter::contentTypeAny) |
| 105 { | 105 { |
| 106 contentType = GetContentTypeFromURL(src); | 106 contentType = GetContentTypeFromURL(src); |
| 107 } | 107 } |
| 108 return contentType; | 108 return contentType; |
| 109 } | 109 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 { | 228 { |
| 229 CPluginDebug::DebugResultBlocking(type, src, boundDomain); | 229 CPluginDebug::DebugResultBlocking(type, src, boundDomain); |
| 230 } | 230 } |
| 231 else | 231 else |
| 232 { | 232 { |
| 233 CPluginDebug::DebugResultIgnoring(type, src, boundDomain); | 233 CPluginDebug::DebugResultIgnoring(type, src, boundDomain); |
| 234 } | 234 } |
| 235 #endif | 235 #endif |
| 236 | 236 |
| 237 //Fixes the iframe back button issue | 237 //Fixes the iframe back button issue |
| 238 if (client->GetIEVersion() > 6) | 238 if (AdblockPlus::IE::installed_major_version() > 6) |
| 239 { | 239 { |
| 240 if ((contentType == CFilter::contentTypeImage) && (isBlocked)) | 240 if ((contentType == CFilter::contentTypeImage) && (isBlocked)) |
| 241 { | 241 { |
| 242 m_shouldBlock = true; | 242 m_shouldBlock = true; |
| 243 BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, pTa rgetProtocol); | 243 BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, pTa rgetProtocol); |
| 244 | 244 |
| 245 return INET_E_REDIRECT_FAILED; | 245 return INET_E_REDIRECT_FAILED; |
| 246 | 246 |
| 247 } | 247 } |
| 248 if (((contentType == CFilter::contentTypeSubdocument))&& (isBlocked)) | 248 if (((contentType == CFilter::contentTypeSubdocument))&& (isBlocked)) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, | 395 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, |
| 396 dwReserved, m_spInternetProtocol); | 396 dwReserved, m_spInternetProtocol); |
| 397 } | 397 } |
| 398 | 398 |
| 399 STDMETHODIMP WBPassthru::Read( /* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) | 399 STDMETHODIMP WBPassthru::Read( /* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) |
| 400 { | 400 { |
| 401 | 401 |
| 402 WBPassthruSink* pSink = GetSink(); | 402 WBPassthruSink* pSink = GetSink(); |
| 403 return pSink->Read(pv, cb, pcbRead); | 403 return pSink->Read(pv, cb, pcbRead); |
| 404 } | 404 } |
| OLD | NEW |