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

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 29331767: Issue #1234 + Clean up - CPluginTab (dead code, nullptr defect fix, etc.) (Closed)
Patch Set: Created Dec. 2, 2015, 6:35 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
« no previous file with comments | « src/plugin/PluginTabBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginTabBase.cpp
===================================================================
--- a/src/plugin/PluginTabBase.cpp
+++ b/src/plugin/PluginTabBase.cpp
@@ -25,13 +25,11 @@
#include "../shared/Utils.h"
#include <Mshtmhst.h>
-CPluginTabBase::CPluginTabBase(CPluginClass* plugin)
- : m_plugin(plugin)
- , m_isActivated(false)
+CPluginTabBase::CPluginTabBase()
+ : m_isActivated(false)
, m_continueThreadRunning(true)
{
- m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter());
- m_filter->hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL);
+ m_filter.hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL);
CPluginClient* client = CPluginClient::GetInstance();
if (AdblockPlus::IE::InstalledMajorVersion() < 10)
@@ -76,12 +74,12 @@
namespace
{
// Entry Point
- void FilterLoader(CPluginTabBase* tabBase)
+ void FilterLoader(CPluginFilter* filter, const std::wstring& domain)
{
try
{
- tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(tabBase->GetDocumentDomain()));
- SetEvent(tabBase->m_filter->hideFiltersLoadedEvent);
+ filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(domain));
+ SetEvent(filter->hideFiltersLoadedEvent);
}
catch (...)
{
@@ -95,10 +93,10 @@
SetDocumentUrl(url);
ClearFrameCache(GetDocumentDomain());
std::wstring domainString = GetDocumentDomain();
- ResetEvent(m_filter->hideFiltersLoadedEvent);
+ ResetEvent(m_filter.hideFiltersLoadedEvent);
try
{
- std::thread filterLoaderThread(&FilterLoader, this);
+ std::thread filterLoaderThread(&FilterLoader, &m_filter, GetDocumentDomain());
filterLoaderThread.detach(); // TODO: but actually we should wait for the thread in the dtr.
}
catch (const std::system_error& ex)
« no previous file with comments | « src/plugin/PluginTabBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld