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

Unified Diff: src/plugin/PluginTabBase.cpp

Issue 11427013: Appear fast for IE (Closed)
Patch Set: Comments addressed Created Aug. 7, 2013, 4:01 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
@@ -29,6 +29,7 @@
CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isActivated(false)
{
m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter());
+ m_filter->hideFiltersLoadedEvent = CreateEvent(NULL, true, false, NULL);
CPluginClient* client = CPluginClient::GetInstance();
if (client->GetIEVersion() < 10)
@@ -82,6 +83,13 @@
m_isActivated = true;
}
+DWORD WINAPI FilterLoader(void* thisPtrVoid)
Wladimir Palant 2013/08/13 09:41:02 Use LPVOID rather than void* to match ThreadProc s
+{
+ CPluginTabBase* thisPtr = (CPluginTabBase*)thisPtrVoid;
Wladimir Palant 2013/08/13 09:41:02 Given that there really is no "this" pointer here
+ thisPtr->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(thisPtr->GetDocumentDomain().GetString()));
+ SetEvent(thisPtr->m_filter->hideFiltersLoadedEvent);
+ return 0;
+}
void CPluginTabBase::OnNavigate(const CString& url)
{
@@ -93,7 +101,8 @@
#endif
std::wstring domainString = GetDocumentDomain();
- m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelectors(domainString));
+ ResetEvent(m_filter->hideFiltersLoadedEvent);
+ CreateThread(NULL, NULL, &FilterLoader, this, NULL, NULL);
#ifdef SUPPORT_DOM_TRAVERSER
m_traverser->ClearCache();

Powered by Google App Engine
This is Rietveld