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

Unified Diff: src/plugin/PluginDomTraverserBase.h

Issue 5698769010032640: Issue #1466 - fix usage of BSTR (Closed)
Patch Set: rebased Created Jan. 29, 2015, 5:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginDomTraverserBase.h
diff --git a/src/plugin/PluginDomTraverserBase.h b/src/plugin/PluginDomTraverserBase.h
index 546e0b70a862b723b24f175a916b82dddafd2f90..923efd41c57f21f2417f9b1b84a5e4cb24ac3c02 100644
--- a/src/plugin/PluginDomTraverserBase.h
+++ b/src/plugin/PluginDomTraverserBase.h
@@ -1,20 +1,20 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
+/*
+ * This file is part of Adblock Plus <https://adblockplus.org/>,
+ * Copyright (C) 2006-2015 Eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef _PLUGIN_DOM_TRAVERSER_BASE_H_
#define _PLUGIN_DOM_TRAVERSER_BASE_H_
@@ -136,7 +136,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
VARIANT_BOOL isBusy;
if (SUCCEEDED(pBrowser->get_Busy(&isBusy)))
{
- if (isBusy)
+ if (isBusy != VARIANT_FALSE)
{
return;
}
@@ -171,7 +171,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
else
{
CComPtr<IHTMLElementCollection> pBodyCollection;
- if (FAILED(pDoc->getElementsByTagName(L"body", &pBodyCollection)) || !pBodyCollection)
+ if (FAILED(pDoc->getElementsByTagName(ATL::CComBSTR(L"body"), &pBodyCollection)) || !pBodyCollection)
{
return;
}
@@ -194,7 +194,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
{
CComVariant vCacheIndex;
- if (FAILED(pBodyEl->getAttribute(L"abp", 0, &vCacheIndex)) || vCacheIndex.vt == VT_NULL)
+ if (FAILED(pBodyEl->getAttribute(ATL::CComBSTR(L"abp"), 0, &vCacheIndex)) || vCacheIndex.vt == VT_NULL)
{
ClearCache();
}
@@ -220,7 +220,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
// eg. http://gamecopyworld.com/
long frameCount = 0;
CComPtr<IHTMLElementCollection> pFrameCollection;
- if (SUCCEEDED(pDoc->getElementsByTagName(L"frame", &pFrameCollection)) && pFrameCollection)
+ if (SUCCEEDED(pDoc->getElementsByTagName(ATL::CComBSTR(L"frame"), &pFrameCollection)) && pFrameCollection)
{
pFrameCollection->get_length(&frameCount);
}
@@ -258,7 +258,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
{
long frameCount = 0;
CComPtr<IHTMLElementCollection> pFrameCollection;
- if (SUCCEEDED(pDoc->getElementsByTagName(L"iframe", &pFrameCollection)) && pFrameCollection)
+ if (SUCCEEDED(pDoc->getElementsByTagName(ATL::CComBSTR(L"iframe"), &pFrameCollection)) && pFrameCollection)
{
pFrameCollection->get_length(&frameCount);
}
@@ -277,7 +277,7 @@ void CPluginDomTraverserBase<T>::TraverseDocument(IWebBrowser2* pBrowser, bool i
{
CComVariant vAttr;
- if (SUCCEEDED(pFrameEl->getAttribute(L"src", 0, &vAttr)) && vAttr.vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0)
+ if (SUCCEEDED(pFrameEl->getAttribute(ATL::CComBSTR(L"scr"), 0, &vAttr)) && vAttr.vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0)
{
CString srcLegacy = vAttr.bstrVal;
@@ -322,7 +322,7 @@ void CPluginDomTraverserBase<T>::TraverseChild(IHTMLElement* pEl, IWebBrowser2*
m_criticalSection.Lock();
{
CComVariant vCacheIndex;
- if (isCached && SUCCEEDED(pEl->getAttribute(L"abp", 0, &vCacheIndex)) && vCacheIndex.vt == VT_I4)
+ if (isCached && SUCCEEDED(pEl->getAttribute(ATL::CComBSTR(L"abp"), 0, &vCacheIndex)) && vCacheIndex.vt == VT_I4)
{
cacheIndex = vCacheIndex.intVal;
@@ -353,7 +353,7 @@ void CPluginDomTraverserBase<T>::TraverseChild(IHTMLElement* pEl, IWebBrowser2*
vCacheIndex.vt = VT_I4;
vCacheIndex.intVal = cacheIndex;
- pEl->setAttribute(L"abp", vCacheIndex);
+ pEl->setAttribute(ATL::CComBSTR(L"abp"), vCacheIndex);
}
}
m_criticalSection.Unlock();
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld