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

Side by Side Diff: src/plugin/PluginTabBase.cpp

Issue 5351131051982848: Issues #1173 - Add exception handler to entry point FilterLoader (Closed)
Patch Set: Created Feb. 12, 2015, 7:26 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 79
80 void CPluginTabBase::OnUpdate() 80 void CPluginTabBase::OnUpdate()
81 { 81 {
82 m_isActivated = true; 82 m_isActivated = true;
83 } 83 }
84 84
85 namespace 85 namespace
86 { 86 {
87 // Entry Point
87 void FilterLoader(CPluginTabBase* tabBase) 88 void FilterLoader(CPluginTabBase* tabBase)
88 { 89 {
89 tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementH idingSelectors(tabBase->GetDocumentDomain())); 90 try
90 SetEvent(tabBase->m_filter->hideFiltersLoadedEvent); 91 {
92 tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElemen tHidingSelectors(tabBase->GetDocumentDomain()));
93 SetEvent(tabBase->m_filter->hideFiltersLoadedEvent);
94 }
95 catch (...)
96 {
97 // There's presently a race condition between loading filters and terminat ing the appplication; see #1654.
98 // In this particular case, it's OK to simply suppress the exception.
sergei 2015/02/13 14:41:40 This comment is not relevant as well.
Eric 2015/02/13 15:13:52 This wording is indeed not right. I've changed it
99 }
91 } 100 }
92 } 101 }
93 102
94 void CPluginTabBase::OnNavigate(const std::wstring& url) 103 void CPluginTabBase::OnNavigate(const std::wstring& url)
95 { 104 {
96 SetDocumentUrl(url); 105 SetDocumentUrl(url);
97 ClearFrameCache(GetDocumentDomain()); 106 ClearFrameCache(GetDocumentDomain());
98 std::wstring domainString = GetDocumentDomain(); 107 std::wstring domainString = GetDocumentDomain();
99 ResetEvent(m_filter->hideFiltersLoadedEvent); 108 ResetEvent(m_filter->hideFiltersLoadedEvent);
100 try 109 try
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId()); 375 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId());
367 } 376 }
368 377
369 // Non-hanging sleep 378 // Non-hanging sleep
370 Sleep(50); 379 Sleep(50);
371 } 380 }
372 381
373 tabLoopIteration++; 382 tabLoopIteration++;
374 } 383 }
375 } 384 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld