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

Unified Diff: src/plugin/PluginSystem.cpp

Issue 29323611: Issue #1234, #2058 - Rewrite log facility, improving thread implementation
Patch Set: rebase to current tip Created Jan. 5, 2016, 2:52 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/PluginSystem.cpp
===================================================================
--- a/src/plugin/PluginSystem.cpp
+++ b/src/plugin/PluginSystem.cpp
@@ -15,41 +15,40 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "PluginStdAfx.h"
-#include "PluginSystem.h"
-#include "PluginClientBase.h"
-#include <array>
-
-std::wstring GetBrowserLanguage()
-{
- LANGID lcid = GetUserDefaultLangID();
- std::wstring lang;
- // According to http://msdn.microsoft.com/en-us/library/windows/desktop/dd373848(v=vs.85).aspx
- // The maximum number of characters allowed for this string is nine, including a terminating null character.
- {
- std::array<wchar_t, 9> localeLanguage;
- int res = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, localeLanguage.data(), localeLanguage.size());
- if (res == 0)
- {
- DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - Failed");
- }
- else
- {
- lang += localeLanguage.data();
- }
- }
- lang += L"-";
- {
- std::array<wchar_t, 9> localeCountry;
- int res = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, localeCountry.data(), localeCountry.size());
- if (res == 0)
- {
- DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country");
- }
- else
- {
- lang += localeCountry.data();
- }
- }
- return lang;
-}
+#include "PluginStdAfx.h"
+#include "PluginSystem.h"
+#include <array>
+
+std::wstring GetBrowserLanguage()
+{
+ LANGID lcid = GetUserDefaultLangID();
+ std::wstring lang;
+ // According to http://msdn.microsoft.com/en-us/library/windows/desktop/dd373848(v=vs.85).aspx
+ // The maximum number of characters allowed for this string is nine, including a terminating null character.
+ {
+ std::array<wchar_t, 9> localeLanguage;
+ int res = GetLocaleInfoW(lcid, LOCALE_SISO639LANGNAME, localeLanguage.data(), localeLanguage.size());
+ if (res == 0)
+ {
+ DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - Failed");
+ }
+ else
+ {
+ lang += localeLanguage.data();
+ }
+ }
+ lang += L"-";
+ {
+ std::array<wchar_t, 9> localeCountry;
+ int res = GetLocaleInfoW(lcid, LOCALE_SISO3166CTRYNAME, localeCountry.data(), localeCountry.size());
+ if (res == 0)
+ {
+ DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country");
+ }
+ else
+ {
+ lang += localeCountry.data();
+ }
+ }
+ return lang;
+}

Powered by Google App Engine
This is Rietveld