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

Unified Diff: src/plugin/PluginDomTraverserBase.h

Issue 5733210436665344: Issue #1234 - Remove local CString variable from TraverseDocument() (Closed)
Patch Set: Created Oct. 9, 2015, 3:48 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
Index: src/plugin/PluginDomTraverserBase.h
===================================================================
--- a/src/plugin/PluginDomTraverserBase.h
+++ b/src/plugin/PluginDomTraverserBase.h
@@ -277,21 +277,19 @@
if (SUCCEEDED(pFrameEl->getAttribute(ATL::CComBSTR(L"src"), 0, &vAttr)) && vAttr.vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0)
{
- CString srcLegacy = vAttr.bstrVal;
+ std::wstring src(vAttr.bstrVal, SysStringLen(vAttr.bstrVal));
// Some times, domain is missing. Should this be added on image src's as well?''
-
// eg. gadgetzone.com.au
- if (srcLegacy.Left(2) == L"//")
+ if (BeginsWith(src, L"//"))
{
- srcLegacy = L"http:" + srcLegacy;
+ src = L"http:" + src;
}
// eg. http://w3schools.com/html/html_examples.asp
- else if (srcLegacy.Left(4) != L"http" && srcLegacy.Left(6) != L"res://")
+ else if (!(BeginsWith(src, L"http") || BeginsWith(src, L"res://")))
{
- srcLegacy = L"http://" + ToCString(m_domain) + srcLegacy;
+ src = L"http://" + m_domain + src;
}
- std::wstring src(ToWstring(srcLegacy));
UnescapeUrl(src);
// Check if Iframe should be traversed
« no previous file with comments | « adblockplus.gyp ('k') | src/plugin/PluginUtil.h » ('j') | src/plugin/PluginUtil.h » ('J')

Powered by Google App Engine
This is Rietveld