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

Unified Diff: src/plugin/PluginWbPassThrough.cpp

Issue 4912420225024000: Issue #1234 - Convert strings associated with URL's (Closed)
Patch Set: Created Jan. 5, 2015, 4:15 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
« src/plugin/PluginWbPassThrough.h ('K') | « src/plugin/PluginWbPassThrough.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginWbPassThrough.cpp
===================================================================
--- a/src/plugin/PluginWbPassThrough.cpp
+++ b/src/plugin/PluginWbPassThrough.cpp
@@ -109,14 +109,15 @@
return CFilter::contentTypeAny;
}
-int WBPassthruSink::GetContentTypeFromURL(const CString& src)
+int WBPassthruSink::GetContentTypeFromURL(const std::wstring& src)
{
- CString srcExt = src;
+ CString srcLegacy = ToCString(src);
+ CString srcExt = srcLegacy;
int pos = 0;
- if ((pos = src.Find('?')) > 0)
+ if ((pos = srcLegacy.Find('?')) > 0)
{
- srcExt = src.Left(pos);
+ srcExt = srcLegacy.Left(pos);
}
int lastDotIndex = srcExt.ReverseFind('.');
@@ -150,7 +151,7 @@
return CFilter::contentTypeAny;
}
-int WBPassthruSink::GetContentType(const CString& mimeType, const std::wstring& domain, const CString& src)
+int WBPassthruSink::GetContentType(const CString& mimeType, const std::wstring& domain, const std::wstring& src)
{
// No referer or mime type
// BINDSTRING_XDR_ORIGIN works only for IE v8+
@@ -305,15 +306,15 @@
if (tab && client)
{
- CString documentUrl = tab->GetDocumentUrl();
+ std::wstring documentUrl = tab->GetDocumentUrl();
// Page is identical to document => don't block
- if (documentUrl == ToCString(src))
+ if (documentUrl == src)
{
return nativeHr;
}
- else if (CPluginSettings::GetInstance()->IsPluginEnabled() && !client->IsWhitelistedUrl(std::wstring(documentUrl)))
+ else if (CPluginSettings::GetInstance()->IsPluginEnabled() && !client->IsWhitelistedUrl(documentUrl))
{
- if (tab->IsFrameCached(ToCString(src)))
+ if (tab->IsFrameCached(src))
{
m_contentType = CFilter::contentTypeSubdocument;
}
« src/plugin/PluginWbPassThrough.h ('K') | « src/plugin/PluginWbPassThrough.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld