Index: src/plugin/PluginTabBase.cpp |
=================================================================== |
--- a/src/plugin/PluginTabBase.cpp |
+++ b/src/plugin/PluginTabBase.cpp |
@@ -17,7 +17,6 @@ |
#include "PluginStdAfx.h" |
#include "AdblockPlusClient.h" |
-#include "PluginClientBase.h" |
#include "PluginSettings.h" |
#include "AdblockPlusDomTraverser.h" |
#include "PluginTabBase.h" |
@@ -26,27 +25,11 @@ |
CPluginTabBase::CPluginTabBase(CPluginClass* plugin) |
: m_plugin(plugin) |
- , m_isActivated(false) |
- , m_continueThreadRunning(true) |
{ |
m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter()); |
m_filter->hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL); |
CPluginClient* client = CPluginClient::GetInstance(); |
- if (AdblockPlus::IE::InstalledMajorVersion() < 10) |
- { |
- m_isActivated = true; |
- } |
- |
- try |
- { |
- m_thread = std::thread(&CPluginTabBase::ThreadProc, this); |
- } |
- catch (const std::system_error& ex) |
- { |
- DEBUG_SYSTEM_EXCEPTION(ex, PLUGIN_ERROR_THREAD, PLUGIN_ERROR_TAB_THREAD_CREATE_PROCESS, |
- "Tab::Thread - Failed to create tab thread"); |
- } |
m_traverser = new CPluginDomTraverser(static_cast<CPluginTab*>(this)); |
} |
@@ -55,21 +38,6 @@ |
{ |
delete m_traverser; |
m_traverser = NULL; |
- m_continueThreadRunning = false; |
- if (m_thread.joinable()) { |
- m_thread.join(); |
- } |
-} |
- |
-void CPluginTabBase::OnActivate() |
-{ |
- m_isActivated = true; |
-} |
- |
- |
-void CPluginTabBase::OnUpdate() |
-{ |
- m_isActivated = true; |
} |
namespace |
@@ -307,59 +275,3 @@ |
m_criticalSectionCache.Unlock(); |
} |
-void CPluginTabBase::ThreadProc() |
-{ |
- // Force loading/creation of settings |
- CPluginSettings::GetInstance(); |
- |
- std::string message = |
- "================================================================================\n" |
- "TAB THREAD process="; |
- message += std::to_string(::GetCurrentProcessId()); |
- message + " thread="; |
- message += std::to_string(::GetCurrentThreadId()); |
- message += |
- "\n" |
- "================================================================================"; |
- DEBUG_GENERAL(message); |
- |
- // -------------------------------------------------------------------- |
- // Tab loop |
- // -------------------------------------------------------------------- |
- |
- DWORD loopCount = 0; |
- DWORD tabLoopIteration = 1; |
- |
- while (this->m_continueThreadRunning) |
- { |
-#ifdef ENABLE_DEBUG_THREAD |
- CStringA sTabLoopIteration; |
- sTabLoopIteration.Format("%u", tabLoopIteration); |
- |
- DEBUG_THREAD("--------------------------------------------------------------------------------") |
- DEBUG_THREAD("Loop iteration " + sTabLoopIteration); |
- DEBUG_THREAD("--------------------------------------------------------------------------------") |
-#endif |
- this->m_isActivated = false; |
- |
- // -------------------------------------------------------------------- |
- // End loop |
- // -------------------------------------------------------------------- |
- |
- // Sleep loop |
- while (this->m_continueThreadRunning && !this->m_isActivated && (++loopCount % (TIMER_THREAD_SLEEP_TAB_LOOP / 50)) != 0) |
- { |
- // Post async plugin error |
- CPluginError pluginError; |
- if (LogQueue::PopFirstPluginError(pluginError)) |
- { |
- LogQueue::LogPluginError(pluginError.GetErrorCode(), pluginError.GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true, pluginError.GetProcessId(), pluginError.GetThreadId()); |
- } |
- |
- // Non-hanging sleep |
- Sleep(50); |
- } |
- |
- tabLoopIteration++; |
- } |
-} |