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

Unified Diff: src/plugin/PluginTabBase.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/PluginTabBase.cpp
===================================================================
--- a/src/plugin/PluginTabBase.cpp
+++ b/src/plugin/PluginTabBase.cpp
@@ -25,6 +25,18 @@
int CPluginTabBase::s_configVersion = 0;
#endif
+namespace
+{
+ CString ExtractDomain(const CString& url)
+ {
+ int pos = 0;
+ if (url.Find('/', pos) >= 0)
+ url.Tokenize(L"/", pos);
+ CString domain = url.Tokenize(L"/", pos);
+ domain.MakeLower();
+ return domain;
+ }
+}
CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isActivated(false)
{
@@ -261,7 +273,7 @@
m_criticalSection.Lock();
{
m_documentUrl = url;
- m_documentDomain = CPluginClient::ExtractDomain(url);
+ m_documentDomain = ExtractDomain(url);
domain = m_documentDomain;
}

Powered by Google App Engine
This is Rietveld