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

Unified Diff: src/plugin/PluginClientBase.cpp

Issue 10955040: Fix domain whitelisting and remove unused code (Closed)
Patch Set: Addressed all issues Created June 25, 2013, 2:19 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/PluginClientBase.cpp
===================================================================
--- a/src/plugin/PluginClientBase.cpp
+++ b/src/plugin/PluginClientBase.cpp
@@ -52,18 +52,6 @@
}
-CString CPluginClientBase::ExtractDomain(const CString& url)
-{
- int pos = 0;
- CString http = url.Find('/',pos) >= 0 ? url.Tokenize(L"/", pos) : L"";
- CString domain = url.Tokenize(L"/", pos);
-
- domain.MakeLower();
-
- return domain;
-}
-
-
CString& CPluginClientBase::UnescapeUrl(CString& url)
{
CString unescapedUrl;
@@ -155,32 +143,3 @@
return hasError;
}
-
-// ============================================================================
-// Whitelisting
-// ============================================================================
-
-#ifdef SUPPORT_WHITELIST
-
-bool CPluginClientBase::IsUrlWhiteListed(const CString& url)
-{
- if (url.IsEmpty())
- {
- return false;
- }
-
- int pos = 0;
- CString scheme = url.Find('/',pos) >= 0 ? url.Tokenize(L"/", pos) : L"";
- CString domain = ExtractDomain(url);
- if (scheme == L"res:" || scheme == L"file:")
- {
- return true;
- }
-
- // TODO: Caching whitelist entries in PluginSettings is redundant and wasteful. We should have an engine call for IsWhitelistedDomain.
- CPluginSettings* pluginSettings = CPluginSettings::GetInstance();
- pluginSettings->RefreshWhitelist();
- return pluginSettings->IsWhiteListedDomain(domain);
-}
-
-#endif // SUPPORT_WHITELIST

Powered by Google App Engine
This is Rietveld