| OLD | NEW |
| 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/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 DWORD WINAPI UtilityProcess_GetFontDataPatch( | 216 DWORD WINAPI UtilityProcess_GetFontDataPatch( |
| 217 HDC hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD length) { | 217 HDC hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD length) { |
| 218 int rv = GetFontData(hdc, table, offset, buffer, length); | 218 int rv = GetFontData(hdc, table, offset, buffer, length); |
| 219 if (rv == GDI_ERROR && hdc) { | 219 if (rv == GDI_ERROR && hdc) { |
| 220 HFONT font = static_cast<HFONT>(GetCurrentObject(hdc, OBJ_FONT)); | 220 HFONT font = static_cast<HFONT>(GetCurrentObject(hdc, OBJ_FONT)); |
| 221 | 221 |
| 222 LOGFONT logfont; | 222 LOGFONT logfont; |
| 223 if (GetObject(font, sizeof(LOGFONT), &logfont)) { | 223 if (GetObject(font, sizeof(LOGFONT), &logfont)) { |
| 224 std::vector<char> font_data; | 224 std::vector<char> font_data; |
| 225 if (UtilityThread::current()->Send( | 225 if (UtilityThread::current()->Send( |
| 226 new ChromeUtilityHostMsg_PreCacheFont(logfont))) | 226 new ChromeUtilityHostMsg_PreCacheFont(logfont, |
| 227 GetCurrentProcessId()))) { |
| 227 rv = GetFontData(hdc, table, offset, buffer, length); | 228 rv = GetFontData(hdc, table, offset, buffer, length); |
| 229 UtilityThread::current()->Send( |
| 230 new ChromeUtilityHostMsg_ReleaseCachedFont(GetCurrentProcessId())); |
| 231 } |
| 228 } | 232 } |
| 229 } | 233 } |
| 230 return rv; | 234 return rv; |
| 231 } | 235 } |
| 232 | 236 |
| 233 bool ChromeContentUtilityClient::RenderPDFToWinMetafile( | 237 bool ChromeContentUtilityClient::RenderPDFToWinMetafile( |
| 234 base::PlatformFile pdf_file, | 238 base::PlatformFile pdf_file, |
| 235 const FilePath& metafile_path, | 239 const FilePath& metafile_path, |
| 236 const gfx::Rect& render_area, | 240 const gfx::Rect& render_area, |
| 237 int render_dpi, | 241 int render_dpi, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded( | 350 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded( |
| 347 printer_name, printer_info)); | 351 printer_name, printer_info)); |
| 348 } else { | 352 } else { |
| 349 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( | 353 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( |
| 350 printer_name)); | 354 printer_name)); |
| 351 } | 355 } |
| 352 UtilityThread::current()->ReleaseProcessIfNeeded(); | 356 UtilityThread::current()->ReleaseProcessIfNeeded(); |
| 353 } | 357 } |
| 354 | 358 |
| 355 } // namespace chrome | 359 } // namespace chrome |
| OLD | NEW |