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: Created Oct. 8, 2014, 2:48 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 | « src/plugin/ATL_Deprecate.h ('k') | 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 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClient.h" 3 #include "PluginClient.h"
4 #include "PluginFilter.h" 4 #include "PluginFilter.h"
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 6
7 #include "AdblockPlusDomTraverser.h" 7 #include "AdblockPlusDomTraverser.h"
8 8
9 9
10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB ase(tab) 10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB ase(tab)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 { 42 {
43 HideElement(pEl, tag, "", false, indent); 43 HideElement(pEl, tag, "", false, indent);
44 return false; 44 return false;
45 } 45 }
46 46
47 // Images 47 // Images
48 if (tag == "img") 48 if (tag == "img")
49 { 49 {
50 CComVariant vAttr; 50 CComVariant vAttr;
51 51
52 if (SUCCEEDED(pEl->getAttribute(L"src", 0, &vAttr)) && vAttr.vt == VT_BSTR & & ::SysStringLen(vAttr.bstrVal) > 0) 52 if (SUCCEEDED(pEl->getAttribute(ATL::CComBSTR(L"src"), 0, &vAttr)) && vAttr. vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0)
Eric 2014/10/09 13:54:01 As I said in the previous review, I object to usin
sergei 2014/10/16 08:53:25 - I would say that speaking about maintainability
Oleksandr 2014/10/17 07:38:02 - I agree that using ATL's class is better then ou
Eric 2014/10/20 04:06:24 The main way that the code becomes cleaner by usin
Eric 2014/10/20 04:06:24 What we decided was that there was little rush to
Eric 2014/10/20 04:06:24 From what I can tell, I don't think you spent any
Eric 2014/10/20 04:06:24 It is possible to define a class for the kind of e
Oleksandr 2014/10/21 23:53:19 I really don't think we should be having prolonged
53 { 53 {
54 CString src = vAttr.bstrVal; 54 CString src = vAttr.bstrVal;
55 CPluginClient::UnescapeUrl(src); 55 CPluginClient::UnescapeUrl(src);
56 56
57 // If src should be blocked, set style display:none on image 57 // If src should be blocked, set style display:none on image
58 cache->m_isHidden = client->ShouldBlock(to_wstring(src), CFilter::contentT ypeImage, m_domain); 58 cache->m_isHidden = client->ShouldBlock(to_wstring(src), CFilter::contentT ypeImage, m_domain);
59 if (cache->m_isHidden) 59 if (cache->m_isHidden)
60 { 60 {
61 HideElement(pEl, "image", src, true, indent); 61 HideElement(pEl, "image", src, true, indent);
62 return false; 62 return false;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 #ifdef ENABLE_DEBUG_RESULT 137 #ifdef ENABLE_DEBUG_RESULT
138 if (isDebug) 138 if (isDebug)
139 { 139 {
140 CPluginDebug::DebugResultHiding(type, url, "-"); 140 CPluginDebug::DebugResultHiding(type, url, "-");
141 } 141 }
142 #endif // ENABLE_DEBUG_RESULT 142 #endif // ENABLE_DEBUG_RESULT
143 } 143 }
144 } 144 }
145 } 145 }
OLDNEW
« no previous file with comments | « src/plugin/ATL_Deprecate.h ('k') | src/plugin/PluginDomTraverserBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld