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

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 5948518908821504: Issue #1158 - removed unnecessary definitions and #ifdef/#else/#endif sections (Closed)
Patch Set: Created Aug. 6, 2014, 7:38 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
@@ -2,13 +2,9 @@
#include "PluginClient.h"
#include "PluginSettings.h"
-#ifdef SUPPORT_CONFIG
-#include "PluginConfig.h"
-#endif
#include "PluginTab.h"
#include "PluginDomTraverser.h"
#include "PluginClass.h"
-
#include "PluginTabBase.h"
#include "PluginUtil.h"
#include <dispex.h>
@@ -16,16 +12,8 @@
int CPluginTabBase::s_dictionaryVersion = 0;
int CPluginTabBase::s_settingsVersion = 1;
-#ifdef SUPPORT_FILTER
int CPluginTabBase::s_filterVersion = 0;
-#endif
-#ifdef SUPPORT_WHITELIST
int CPluginTabBase::s_whitelistVersion = 0;
-#endif
-#ifdef SUPPORT_CONFIG
-int CPluginTabBase::s_configVersion = 0;
-#endif
-
CPluginTabBase::CPluginTabBase(CPluginClass* plugin)
: m_plugin(plugin)
@@ -51,20 +39,14 @@
ex.code().message() + ex.what();
DEBUG_ERROR_LOG(ex.code().value(), PLUGIN_ERROR_THREAD, PLUGIN_ERROR_TAB_THREAD_CREATE_PROCESS, errDescription.c_str());
}
-
-#ifdef SUPPORT_DOM_TRAVERSER
Oleksandr 2014/08/18 20:46:04 I would leave this ifdef and others concerning the
Felix Dahlke 2014/09/30 09:33:29 IMHO the traverser code is pretty well isolated fr
Oleksandr 2014/10/02 21:24:02 Good point. Agreed. On 2014/09/30 09:33:29, Felix
m_traverser = new CPluginDomTraverser(static_cast<CPluginTab*>(this));
-#endif // SUPPORT_DOM_TRAVERSER
}
CPluginTabBase::~CPluginTabBase()
{
-#ifdef SUPPORT_DOM_TRAVERSER
delete m_traverser;
m_traverser = NULL;
-#endif // SUPPORT_DOM_TRAVERSER
-
m_continueThreadRunning = false;
if (m_thread.joinable()) {
m_thread.join();
@@ -94,12 +76,7 @@
void CPluginTabBase::OnNavigate(const CString& url)
{
SetDocumentUrl(url);
-
-
-#ifdef SUPPORT_FRAME_CACHING
ClearFrameCache(GetDocumentDomain());
-#endif
-
std::wstring domainString = GetDocumentDomain();
ResetEvent(m_filter->hideFiltersLoadedEvent);
try
@@ -113,10 +90,7 @@
ex.code().message() + ex.what();
DEBUG_ERROR_LOG(ex.code().value(), PLUGIN_ERROR_THREAD, PLUGIN_ERROR_MAIN_THREAD_CREATE_PROCESS, errDescription.c_str());
}
-
-#ifdef SUPPORT_DOM_TRAVERSER
m_traverser->ClearCache();
-#endif
}
void CPluginTabBase::InjectABP(IWebBrowser2* browser)
@@ -182,13 +156,10 @@
void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser)
{
-#ifdef SUPPORT_DOM_TRAVERSER
if (!CPluginClient::GetInstance()->IsWhitelistedUrl(std::wstring(GetDocumentUrl())))
{
m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl());
}
-#endif // SUPPORT_DOM_TRAVERSER
-
InjectABP(browser);
}
@@ -204,8 +175,6 @@
}
InjectABP(browser);
}
-
-#ifdef SUPPORT_DOM_TRAVERSER
if (url.Left(6) != "res://")
{
// Get document
@@ -241,7 +210,6 @@
pDoc.Release();
pDocDispatch.Release();
}
-#endif
}
CString CPluginTabBase::GetDocumentDomain()
@@ -284,9 +252,6 @@
// ============================================================================
// Frame caching
// ============================================================================
-
-#ifdef SUPPORT_FRAME_CACHING
-
bool CPluginTabBase::IsFrameCached(const CString& url)
{
bool isFrame;
@@ -322,9 +287,6 @@
m_criticalSectionCache.Unlock();
}
-#endif // SUPPORT_FRAME_CACHING
-
-
void CPluginTabBase::ThreadProc()
{
// Force loading/creation of settings

Powered by Google App Engine
This is Rietveld