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

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 4912420225024000: Issue #1234 - Convert strings associated with URL's (Closed)
Patch Set: Created Oct. 21, 2014, 5:18 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/PluginTabBase.h ('k') | src/plugin/PluginWbPassThrough.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginTabBase.cpp
===================================================================
--- a/src/plugin/PluginTabBase.cpp
+++ b/src/plugin/PluginTabBase.cpp
@@ -73,7 +73,7 @@
}
}
-void CPluginTabBase::OnNavigate(const CString& url)
+void CPluginTabBase::OnNavigate(const std::wstring& url)
{
SetDocumentUrl(url);
ClearFrameCache(GetDocumentDomain());
@@ -96,7 +96,7 @@
void CPluginTabBase::InjectABP(IWebBrowser2* browser)
{
CriticalSection::Lock lock(m_csInject);
- CString url = GetDocumentUrl();
+ CString url = ToCString(GetDocumentUrl());
CString log;
log.Format(L"InjectABP. Current URL: %s, settings URL: %s", url, UserSettingsFileUrl().c_str());
DEBUG_GENERAL(log);
@@ -157,7 +157,7 @@
void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser)
{
CPluginClient* client = CPluginClient::GetInstance();
- std::wstring url = to_wstring(GetDocumentUrl());
+ std::wstring url = GetDocumentUrl();
if (!client->IsWhitelistedUrl(url) && !client->IsElemhideWhitelistedOnDomain(url))
{
m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl());
@@ -165,9 +165,9 @@
InjectABP(browser);
}
-void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const CString& url, bool isDocumentBrowser)
+void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url, bool isDocumentBrowser)
{
- CString documentUrl = GetDocumentUrl();
+ std::wstring documentUrl = GetDocumentUrl();
if (isDocumentBrowser)
{
@@ -177,7 +177,8 @@
}
InjectABP(browser);
}
- if (url.Left(6) != "res://")
+ CString urlLegacy = ToCString(url);
+ if (urlLegacy.Left(6) != "res://")
{
// Get document
CComPtr<IDispatch> pDocDispatch;
@@ -227,19 +228,19 @@
return domain;
}
-void CPluginTabBase::SetDocumentUrl(const CString& url)
+void CPluginTabBase::SetDocumentUrl(const std::wstring& url)
{
m_criticalSection.Lock();
{
m_documentUrl = url;
- m_documentDomain = CAdblockPlusClient::GetInstance()->GetHostFromUrl(to_wstring(url));
+ m_documentDomain = CAdblockPlusClient::GetInstance()->GetHostFromUrl(url);
}
m_criticalSection.Unlock();
}
-CString CPluginTabBase::GetDocumentUrl()
+std::wstring CPluginTabBase::GetDocumentUrl()
{
- CString url;
+ std::wstring url;
m_criticalSection.Lock();
{
@@ -254,7 +255,7 @@
// ============================================================================
// Frame caching
// ============================================================================
-bool CPluginTabBase::IsFrameCached(const CString& url)
+bool CPluginTabBase::IsFrameCached(const std::wstring& url)
{
bool isFrame;
@@ -267,7 +268,7 @@
return isFrame;
}
-void CPluginTabBase::CacheFrame(const CString& url)
+void CPluginTabBase::CacheFrame(const std::wstring& url)
{
m_criticalSectionCache.Lock();
{
« no previous file with comments | « src/plugin/PluginTabBase.h ('k') | src/plugin/PluginWbPassThrough.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld