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

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

Issue 11013110: Cleanup (Closed)
Patch Set: Created July 5, 2013, 3:28 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 // Internet / FTP 3 // Internet / FTP
4 #include <wininet.h> 4 #include <wininet.h>
5 5
6 // IP adapter 6 // IP adapter
7 #include <iphlpapi.h> 7 #include <iphlpapi.h>
8 8
9 #include "PluginSettings.h" 9 #include "PluginSettings.h"
10 #include "PluginSystem.h" 10 #include "PluginSystem.h"
11 #include "PluginHttpRequest.h"
12 #include "PluginMutex.h" 11 #include "PluginMutex.h"
13 #include "PluginClass.h" 12 #include "PluginClass.h"
14 13
15 #include "PluginClientBase.h" 14 #include "PluginClientBase.h"
16 15
17 // IP adapter 16 // IP adapter
18 #pragma comment(lib, "IPHLPAPI.lib") 17 #pragma comment(lib, "IPHLPAPI.lib")
19 18
20 // IE functions 19 // IE functions
21 #pragma comment(lib, "iepmapi.lib") 20 #pragma comment(lib, "iepmapi.lib")
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 unescapedUrl.Truncate(cb); 62 unescapedUrl.Truncate(cb);
64 63
65 url.ReleaseBuffer(); 64 url.ReleaseBuffer();
66 url = unescapedUrl; 65 url = unescapedUrl;
67 } 66 }
68 67
69 return url; 68 return url;
70 } 69 }
71 70
72 71
73 void CPluginClientBase::SetLocalization()
74 {
75 CPluginSystem* system = CPluginSystem::GetInstance();
76 CString browserLanguage = system->GetBrowserLanguage();
77
78 CPluginSettings* settings = CPluginSettings::GetInstance();
79 if (settings->IsMainProcess() && settings->IsMainThread() && !settings->Has(SE TTING_LANGUAGE))
80 {
81 // TODO: We might want to set this to "en" if browserLanguage is not in filt erLanguagesList
82 settings->SetString(SETTING_LANGUAGE, browserLanguage);
83 settings->Write();
84 }
85 }
86
87
88 void CPluginClientBase::LogPluginError(DWORD errorCode, int errorId, int errorSu bid, const CString& description, bool isAsync, DWORD dwProcessId, DWORD dwThread Id) 72 void CPluginClientBase::LogPluginError(DWORD errorCode, int errorId, int errorSu bid, const CString& description, bool isAsync, DWORD dwProcessId, DWORD dwThread Id)
89 { 73 {
90 // Prevent circular references 74 // Prevent circular references
91 if (CPluginSettings::HasInstance() && isAsync) 75 if (CPluginSettings::HasInstance() && isAsync)
92 { 76 {
93 DEBUG_ERROR_CODE_EX(errorCode, description, dwProcessId, dwThreadId); 77 DEBUG_ERROR_CODE_EX(errorCode, description, dwProcessId, dwThreadId);
94 78
95 CString pluginError; 79 CString pluginError;
96 pluginError.Format(L"%2.2d%2.2d", errorId, errorSubid); 80 pluginError.Format(L"%2.2d%2.2d", errorId, errorSubid);
97 81
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 120
137 hasError = true; 121 hasError = true;
138 122
139 s_pluginErrors.erase(it); 123 s_pluginErrors.erase(it);
140 } 124 }
141 } 125 }
142 s_criticalSectionLocal.Unlock(); 126 s_criticalSectionLocal.Unlock();
143 127
144 return hasError; 128 return hasError;
145 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld