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

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

Issue 5698769010032640: Issue #1466 - fix usage of BSTR (Closed)
Patch Set: rebased Created Jan. 29, 2015, 5:10 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 | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 { 59 {
60 HideElement(pEl, tag, L"", false, indent); 60 HideElement(pEl, tag, L"", false, indent);
61 return false; 61 return false;
62 } 62 }
63 63
64 // Images 64 // Images
65 if (tag == "img") 65 if (tag == "img")
66 { 66 {
67 CComVariant vAttr; 67 CComVariant vAttr;
68 68
69 if (SUCCEEDED(pEl->getAttribute(L"src", 0, &vAttr)) && vAttr.vt == VT_BSTR & & ::SysStringLen(vAttr.bstrVal) > 0) 69 if (SUCCEEDED(pEl->getAttribute(ATL::CComBSTR(L"src"), 0, &vAttr)) && vAttr. vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0)
70 { 70 {
71 std::wstring src(vAttr.bstrVal, SysStringLen(vAttr.bstrVal)); 71 std::wstring src(vAttr.bstrVal, SysStringLen(vAttr.bstrVal));
72 UnescapeUrl(src); 72 UnescapeUrl(src);
73 73
74 // If src should be blocked, set style display:none on image 74 // If src should be blocked, set style display:none on image
75 cache->m_isHidden = client->ShouldBlock(src, CFilter::contentTypeImage, m_ domain); 75 cache->m_isHidden = client->ShouldBlock(src, CFilter::contentTypeImage, m_ domain);
76 if (cache->m_isHidden) 76 if (cache->m_isHidden)
77 { 77 {
78 HideElement(pEl, "image", src, true, indent); 78 HideElement(pEl, "image", src, true, indent);
79 return false; 79 return false;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 #ifdef ENABLE_DEBUG_RESULT 153 #ifdef ENABLE_DEBUG_RESULT
154 if (isDebug) 154 if (isDebug)
155 { 155 {
156 CPluginDebug::DebugResultHiding(type, ToCString(url), "-"); 156 CPluginDebug::DebugResultHiding(type, ToCString(url), "-");
157 } 157 }
158 #endif // ENABLE_DEBUG_RESULT 158 #endif // ENABLE_DEBUG_RESULT
159 } 159 }
160 } 160 }
161 } 161 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld