OLD | NEW |
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 { | 287 { |
288 m_isAdviced = true; | 288 m_isAdviced = true; |
289 | 289 |
290 try | 290 try |
291 { | 291 { |
292 std::thread startInitObjectThread(StartInitObject, this); | 292 std::thread startInitObjectThread(StartInitObject, this); |
293 startInitObjectThread.detach(); // TODO: but actually we should wa
it for the thread in the dtr. | 293 startInitObjectThread.detach(); // TODO: but actually we should wa
it for the thread in the dtr. |
294 } | 294 } |
295 catch (const std::system_error& ex) | 295 catch (const std::system_error& ex) |
296 { | 296 { |
297 auto errDescription = std::string("Class::Thread - Failed to creat
e StartInitObject thread, ") + | 297 DEBUG_SYSTEM_EXCEPTION(ex, PLUGIN_ERROR_THREAD, PLUGIN_ERROR_MAIN_
THREAD_CREATE_PROCESS, |
298 ex.code().message() + ex.what(); | 298 "Class::Thread - Failed to create StartInitObject thread"); |
299 DEBUG_ERROR_LOG(ex.code().value(), PLUGIN_ERROR_THREAD, PLUGIN_ERR
OR_MAIN_THREAD_CREATE_PROCESS, errDescription.c_str()); | |
300 } | 299 } |
301 } | 300 } |
302 else | 301 else |
303 { | 302 { |
304 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_ADV
ICE, "Class::SetSite - Advice"); | 303 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_ADV
ICE, "Class::SetSite - Advice"); |
305 } | 304 } |
306 } | 305 } |
307 } | 306 } |
308 else // Check if loaded as toolbar handler | 307 else // Check if loaded as toolbar handler |
309 { | 308 { |
(...skipping 22 matching lines...) Expand all Loading... |
332 } | 331 } |
333 s_criticalSectionBrowser.Unlock(); | 332 s_criticalSectionBrowser.Unlock(); |
334 } | 333 } |
335 } | 334 } |
336 else | 335 else |
337 { | 336 { |
338 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_QUERY
_SERVICE_PROVIDER, "Class::SetSite - QueryInterface (service provider)"); | 337 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_QUERY
_SERVICE_PROVIDER, "Class::SetSite - QueryInterface (service provider)"); |
339 } | 338 } |
340 } | 339 } |
341 } | 340 } |
342 catch (std::runtime_error e) | 341 catch (const std::runtime_error& ex) |
343 { | 342 { |
344 DEBUG_ERROR(e.what()); | 343 DEBUG_EXCEPTION(ex); |
345 Unadvice(); | 344 Unadvice(); |
346 } | 345 } |
347 } | 346 } |
348 else | 347 else |
349 { | 348 { |
350 // Unadvice | 349 // Unadvice |
351 Unadvice(); | 350 Unadvice(); |
352 | 351 |
353 // Destroy window | 352 // Destroy window |
354 if (m_pWndProcStatus) | 353 if (m_pWndProcStatus) |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 // If webbrowser2 is equal to top level browser (as set in SetSite), we are na
vigating new page | 567 // If webbrowser2 is equal to top level browser (as set in SetSite), we are na
vigating new page |
569 CPluginClient* client = CPluginClient::GetInstance(); | 568 CPluginClient* client = CPluginClient::GetInstance(); |
570 CString urlLegacy = ToCString(url); | 569 CString urlLegacy = ToCString(url); |
571 if (urlLegacy.Find(L"javascript") == 0) | 570 if (urlLegacy.Find(L"javascript") == 0) |
572 { | 571 { |
573 } | 572 } |
574 else if (GetBrowser().IsEqualObject(WebBrowser2Ptr)) | 573 else if (GetBrowser().IsEqualObject(WebBrowser2Ptr)) |
575 { | 574 { |
576 m_tab->OnNavigate(url); | 575 m_tab->OnNavigate(url); |
577 | 576 |
578 DEBUG_GENERAL(L"============================================================
====================\nBegin main navigation url:" + urlLegacy + "\n=============
===================================================================") | 577 DEBUG_GENERAL( |
| 578 L"========================================================================
========\n" |
| 579 L"Begin main navigation url:" + url + L"\n" |
| 580 L"========================================================================
========") |
579 | 581 |
580 #ifdef ENABLE_DEBUG_RESULT | 582 #ifdef ENABLE_DEBUG_RESULT |
581 CPluginDebug::DebugResultDomain(urlLegacy); | 583 CPluginDebug::DebugResultDomain(url); |
582 #endif | 584 #endif |
583 | 585 |
584 UpdateStatusBar(); | 586 UpdateStatusBar(); |
585 } | 587 } |
586 else | 588 else |
587 { | 589 { |
588 DEBUG_NAVI(L"Navi::Begin navigation url:" + urlLegacy) | 590 DEBUG_NAVI(L"Navi::Begin navigation url:" + url) |
589 m_tab->CacheFrame(url); | 591 m_tab->CacheFrame(url); |
590 } | 592 } |
591 } | 593 } |
592 | 594 |
593 /* | 595 /* |
594 * #1163 implements behavior for method DISPID_WINDOWSTATECHANGED in CPluginClas
s::Invoke | 596 * #1163 implements behavior for method DISPID_WINDOWSTATECHANGED in CPluginClas
s::Invoke |
595 * - should validate and convert arguments in Invoke, not here | 597 * - should validate and convert arguments in Invoke, not here |
596 * - does not validate number of arguments before indexing into 'rgvarg' | 598 * - does not validate number of arguments before indexing into 'rgvarg' |
597 * - does not validate type of argument before using its value | 599 * - does not validate type of argument before using its value |
598 */ | 600 */ |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 { | 1787 { |
1786 HICON icon = NULL; | 1788 HICON icon = NULL; |
1787 | 1789 |
1788 s_criticalSectionLocal.Lock(); | 1790 s_criticalSectionLocal.Lock(); |
1789 { | 1791 { |
1790 if (!s_hIcons[type]) | 1792 if (!s_hIcons[type]) |
1791 { | 1793 { |
1792 s_hIcons[type] = ::LoadIcon(_Module.m_hInst, MAKEINTRESOURCE(s_hIconTypes[
type])); | 1794 s_hIcons[type] = ::LoadIcon(_Module.m_hInst, MAKEINTRESOURCE(s_hIconTypes[
type])); |
1793 if (!s_hIcons[type]) | 1795 if (!s_hIcons[type]) |
1794 { | 1796 { |
1795 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon") | 1797 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon"); |
1796 } | 1798 } |
1797 } | 1799 } |
1798 | 1800 |
1799 icon = s_hIcons[type]; | 1801 icon = s_hIcons[type]; |
1800 } | 1802 } |
1801 s_criticalSectionLocal.Unlock(); | 1803 s_criticalSectionLocal.Unlock(); |
1802 | 1804 |
1803 return icon; | 1805 return icon; |
1804 } | 1806 } |
1805 | 1807 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 } | 1872 } |
1871 } | 1873 } |
1872 } | 1874 } |
1873 | 1875 |
1874 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1876 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
1875 } | 1877 } |
1876 | 1878 |
1877 return hTabWnd; | 1879 return hTabWnd; |
1878 | 1880 |
1879 } | 1881 } |
OLD | NEW |