| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 { | 289 { |
| 290 m_isAdviced = true; | 290 m_isAdviced = true; |
| 291 | 291 |
| 292 try | 292 try |
| 293 { | 293 { |
| 294 std::thread startInitObjectThread(StartInitObject, this); | 294 std::thread startInitObjectThread(StartInitObject, this); |
| 295 startInitObjectThread.detach(); // TODO: but actually we should wa
it for the thread in the dtr. | 295 startInitObjectThread.detach(); // TODO: but actually we should wa
it for the thread in the dtr. |
| 296 } | 296 } |
| 297 catch (const std::system_error& ex) | 297 catch (const std::system_error& ex) |
| 298 { | 298 { |
| 299 auto errDescription = std::string("Class::Thread - Failed to creat
e StartInitObject thread, ") + | 299 DEBUG_SYSTEM_EXCEPTION(ex, PLUGIN_ERROR_THREAD, PLUGIN_ERROR_MAIN_
THREAD_CREATE_PROCESS, |
| 300 ex.code().message() + ex.what(); | 300 "Class::Thread - Failed to create StartInitObject thread"); |
| 301 DEBUG_ERROR_LOG(ex.code().value(), PLUGIN_ERROR_THREAD, PLUGIN_ERR
OR_MAIN_THREAD_CREATE_PROCESS, errDescription.c_str()); | |
| 302 } | 301 } |
| 303 } | 302 } |
| 304 else | 303 else |
| 305 { | 304 { |
| 306 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_ADV
ICE, "Class::SetSite - Advice"); | 305 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_ADV
ICE, "Class::SetSite - Advice"); |
| 307 } | 306 } |
| 308 } | 307 } |
| 309 } | 308 } |
| 310 else // Check if loaded as toolbar handler | 309 else // Check if loaded as toolbar handler |
| 311 { | 310 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 334 } | 333 } |
| 335 s_criticalSectionBrowser.Unlock(); | 334 s_criticalSectionBrowser.Unlock(); |
| 336 } | 335 } |
| 337 } | 336 } |
| 338 else | 337 else |
| 339 { | 338 { |
| 340 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_QUERY
_SERVICE_PROVIDER, "Class::SetSite - QueryInterface (service provider)"); | 339 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_SET_SITE, PLUGIN_ERROR_SET_SITE_QUERY
_SERVICE_PROVIDER, "Class::SetSite - QueryInterface (service provider)"); |
| 341 } | 340 } |
| 342 } | 341 } |
| 343 } | 342 } |
| 344 catch (std::runtime_error e) | 343 catch (const std::runtime_error& ex) |
| 345 { | 344 { |
| 346 DEBUG_ERROR(e.what()); | 345 DEBUG_EXCEPTION(ex); |
| 347 Unadvice(); | 346 Unadvice(); |
| 348 } | 347 } |
| 349 } | 348 } |
| 350 else | 349 else |
| 351 { | 350 { |
| 352 // Unadvice | 351 // Unadvice |
| 353 Unadvice(); | 352 Unadvice(); |
| 354 | 353 |
| 355 // Destroy window | 354 // Destroy window |
| 356 if (m_pWndProcStatus) | 355 if (m_pWndProcStatus) |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // If webbrowser2 is equal to top level browser (as set in SetSite), we are na
vigating new page | 569 // If webbrowser2 is equal to top level browser (as set in SetSite), we are na
vigating new page |
| 571 CPluginClient* client = CPluginClient::GetInstance(); | 570 CPluginClient* client = CPluginClient::GetInstance(); |
| 572 CString urlLegacy = ToCString(url); | 571 CString urlLegacy = ToCString(url); |
| 573 if (urlLegacy.Find(L"javascript") == 0) | 572 if (urlLegacy.Find(L"javascript") == 0) |
| 574 { | 573 { |
| 575 } | 574 } |
| 576 else if (GetBrowser().IsEqualObject(WebBrowser2Ptr)) | 575 else if (GetBrowser().IsEqualObject(WebBrowser2Ptr)) |
| 577 { | 576 { |
| 578 m_tab->OnNavigate(url); | 577 m_tab->OnNavigate(url); |
| 579 | 578 |
| 580 DEBUG_GENERAL(L"============================================================
====================\nBegin main navigation url:" + urlLegacy + "\n=============
===================================================================") | 579 DEBUG_GENERAL( |
| 580 L"========================================================================
========\n" |
| 581 L"Begin main navigation url:" + url + L"\n" |
| 582 L"========================================================================
========") |
| 581 | 583 |
| 582 #ifdef ENABLE_DEBUG_RESULT | 584 #ifdef ENABLE_DEBUG_RESULT |
| 583 CPluginDebug::DebugResultDomain(urlLegacy); | 585 CPluginDebug::DebugResultDomain(url); |
| 584 #endif | 586 #endif |
| 585 | 587 |
| 586 UpdateStatusBar(); | 588 UpdateStatusBar(); |
| 587 } | 589 } |
| 588 else | 590 else |
| 589 { | 591 { |
| 590 DEBUG_NAVI(L"Navi::Begin navigation url:" + urlLegacy) | 592 DEBUG_NAVI(L"Navi::Begin navigation url:" + url) |
| 591 m_tab->CacheFrame(url); | 593 m_tab->CacheFrame(url); |
| 592 } | 594 } |
| 593 } | 595 } |
| 594 | 596 |
| 595 /* | 597 /* |
| 596 * #1163 implements behavior for method DISPID_WINDOWSTATECHANGED in CPluginClas
s::Invoke | 598 * #1163 implements behavior for method DISPID_WINDOWSTATECHANGED in CPluginClas
s::Invoke |
| 597 * - should validate and convert arguments in Invoke, not here | 599 * - should validate and convert arguments in Invoke, not here |
| 598 * - does not validate number of arguments before indexing into 'rgvarg' | 600 * - does not validate number of arguments before indexing into 'rgvarg' |
| 599 * - does not validate type of argument before using its value | 601 * - does not validate type of argument before using its value |
| 600 */ | 602 */ |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 | 1801 |
| 1800 s_criticalSectionLocal.Lock(); | 1802 s_criticalSectionLocal.Lock(); |
| 1801 { | 1803 { |
| 1802 if (!s_hIcons[type]) | 1804 if (!s_hIcons[type]) |
| 1803 { | 1805 { |
| 1804 std::wstring imageToLoad = L"#"; | 1806 std::wstring imageToLoad = L"#"; |
| 1805 imageToLoad += std::to_wstring(s_hIconTypes[type]); | 1807 imageToLoad += std::to_wstring(s_hIconTypes[type]); |
| 1806 s_hIcons[type] = (HICON)::LoadImage(_Module.m_hInst, imageToLoad.c_str(),
IMAGE_ICON, iconWidth, iconHeight, LR_SHARED); | 1808 s_hIcons[type] = (HICON)::LoadImage(_Module.m_hInst, imageToLoad.c_str(),
IMAGE_ICON, iconWidth, iconHeight, LR_SHARED); |
| 1807 if (!s_hIcons[type]) | 1809 if (!s_hIcons[type]) |
| 1808 { | 1810 { |
| 1809 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon") | 1811 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_UI, PLUGIN_ERROR_UI_LOAD_
ICON, "Class::GetIcon - LoadIcon"); |
| 1810 } | 1812 } |
| 1811 } | 1813 } |
| 1812 | 1814 |
| 1813 icon = s_hIcons[type]; | 1815 icon = s_hIcons[type]; |
| 1814 } | 1816 } |
| 1815 s_criticalSectionLocal.Unlock(); | 1817 s_criticalSectionLocal.Unlock(); |
| 1816 | 1818 |
| 1817 return icon; | 1819 return icon; |
| 1818 } | 1820 } |
| 1819 | 1821 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1884 } | 1886 } |
| 1885 } | 1887 } |
| 1886 } | 1888 } |
| 1887 | 1889 |
| 1888 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1890 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
| 1889 } | 1891 } |
| 1890 | 1892 |
| 1891 return hTabWnd; | 1893 return hTabWnd; |
| 1892 | 1894 |
| 1893 } | 1895 } |
| OLD | NEW |