Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/common/child_process_logging_win.cc

Issue 9600060: SetPrinterInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/child_process_logging_posix.cc ('k') | 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/child_process_logging.h" 5 #include "chrome/common/child_process_logging.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 19 matching lines...) Expand all
30 // exported in breakpad_win.cc: 30 // exported in breakpad_win.cc:
31 // void __declspec(dllexport) __cdecl SetExtensionID. 31 // void __declspec(dllexport) __cdecl SetExtensionID.
32 typedef void (__cdecl *MainSetExtensionID)(size_t, const wchar_t*); 32 typedef void (__cdecl *MainSetExtensionID)(size_t, const wchar_t*);
33 33
34 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetGpuInfo. 34 // exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetGpuInfo.
35 typedef void (__cdecl *MainSetGpuInfo)(const wchar_t*, const wchar_t*, 35 typedef void (__cdecl *MainSetGpuInfo)(const wchar_t*, const wchar_t*,
36 const wchar_t*, const wchar_t*, 36 const wchar_t*, const wchar_t*,
37 const wchar_t*); 37 const wchar_t*);
38 38
39 // exported in breakpad_win.cc: 39 // exported in breakpad_win.cc:
40 // void __declspec(dllexport) __cdecl SetPrinterInfo.
41 typedef void (__cdecl *MainSetPrinterInfo)(const wchar_t*);
42
43 // exported in breakpad_win.cc:
40 // void __declspec(dllexport) __cdecl SetNumberOfViews. 44 // void __declspec(dllexport) __cdecl SetNumberOfViews.
41 typedef void (__cdecl *MainSetNumberOfViews)(int); 45 typedef void (__cdecl *MainSetNumberOfViews)(int);
42 46
43 // exported in breakpad_win.cc: 47 // exported in breakpad_win.cc:
44 // void __declspec(dllexport) __cdecl SetCommandLine 48 // void __declspec(dllexport) __cdecl SetCommandLine
45 typedef void (__cdecl *MainSetCommandLine)(const CommandLine*); 49 typedef void (__cdecl *MainSetCommandLine)(const CommandLine*);
46 50
47 void SetActiveURL(const GURL& url) { 51 void SetActiveURL(const GURL& url) {
48 static MainSetActiveURL set_active_url = NULL; 52 static MainSetActiveURL set_active_url = NULL;
49 // note: benign race condition on set_active_url. 53 // note: benign race condition on set_active_url.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return; 147 return;
144 } 148 }
145 (set_gpu_info)( 149 (set_gpu_info)(
146 base::StringPrintf(L"0x%04x", gpu_info.vendor_id).c_str(), 150 base::StringPrintf(L"0x%04x", gpu_info.vendor_id).c_str(),
147 base::StringPrintf(L"0x%04x", gpu_info.device_id).c_str(), 151 base::StringPrintf(L"0x%04x", gpu_info.device_id).c_str(),
148 UTF8ToUTF16(gpu_info.driver_version).c_str(), 152 UTF8ToUTF16(gpu_info.driver_version).c_str(),
149 UTF8ToUTF16(gpu_info.pixel_shader_version).c_str(), 153 UTF8ToUTF16(gpu_info.pixel_shader_version).c_str(),
150 UTF8ToUTF16(gpu_info.vertex_shader_version).c_str()); 154 UTF8ToUTF16(gpu_info.vertex_shader_version).c_str());
151 } 155 }
152 156
157 void SetPrinterInfo(const char* printer_info) {
158 static MainSetPrinterInfo set_printer_info = NULL;
159 if (!set_printer_info) {
160 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
161 if (!exe_module)
162 return;
163 set_printer_info = reinterpret_cast<MainSetPrinterInfo>(
164 GetProcAddress(exe_module, "SetPrinterInfo"));
165 if (!set_printer_info)
166 return;
167 }
168 (set_printer_info)(UTF8ToWide(printer_info).c_str());
169 }
170
153 void SetCommandLine(const CommandLine* command_line) { 171 void SetCommandLine(const CommandLine* command_line) {
154 static MainSetCommandLine set_command_line = NULL; 172 static MainSetCommandLine set_command_line = NULL;
155 if (!set_command_line) { 173 if (!set_command_line) {
156 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); 174 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
157 if (!exe_module) 175 if (!exe_module)
158 return; 176 return;
159 set_command_line = reinterpret_cast<MainSetCommandLine>( 177 set_command_line = reinterpret_cast<MainSetCommandLine>(
160 GetProcAddress(exe_module, "SetCommandLine")); 178 GetProcAddress(exe_module, "SetCommandLine"));
161 if (!set_command_line) 179 if (!set_command_line)
162 return; 180 return;
163 } 181 }
164 (set_command_line)(command_line); 182 (set_command_line)(command_line);
165 } 183 }
166 184
167 void SetNumberOfViews(int number_of_views) { 185 void SetNumberOfViews(int number_of_views) {
168 static MainSetNumberOfViews set_number_of_views = NULL; 186 static MainSetNumberOfViews set_number_of_views = NULL;
169 if (!set_number_of_views) { 187 if (!set_number_of_views) {
170 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); 188 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
171 if (!exe_module) 189 if (!exe_module)
172 return; 190 return;
173 set_number_of_views = reinterpret_cast<MainSetNumberOfViews>( 191 set_number_of_views = reinterpret_cast<MainSetNumberOfViews>(
174 GetProcAddress(exe_module, "SetNumberOfViews")); 192 GetProcAddress(exe_module, "SetNumberOfViews"));
175 if (!set_number_of_views) 193 if (!set_number_of_views)
176 return; 194 return;
177 } 195 }
178 (set_number_of_views)(number_of_views); 196 (set_number_of_views)(number_of_views);
179 } 197 }
180 198
181 } // namespace child_process_logging 199 } // namespace child_process_logging
OLDNEW
« no previous file with comments | « chrome/common/child_process_logging_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698