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: Created Aug. 7, 2013, 5:44 a.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
« src/plugin/PluginSettings.cpp ('K') | « src/plugin/PluginSettings.cpp ('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
@@ -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);
Felix Dahlke 2013/08/07 09:34:49 Since this is C++, we should use true and false in
CPluginClient* client = CPluginClient::GetInstance();
if (client->GetIEVersion() < 10)
@@ -82,6 +83,13 @@
m_isActivated = true;
}
+DWORD WINAPI FilterLoader(void* thisPtrVoid)
+{
+ CPluginTabBase* thisPtr = (CPluginTabBase*)thisPtrVoid;
+ 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);
Felix Dahlke 2013/08/07 13:23:03 How I see it, this is the relevant change, right?
Oleksandr 2013/08/07 16:07:40 This is not the only relevant change. This is just
#ifdef SUPPORT_DOM_TRAVERSER
m_traverser->ClearCache();
« src/plugin/PluginSettings.cpp ('K') | « src/plugin/PluginSettings.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld