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

Side by Side Diff: chrome/utility/chrome_content_utility_client.cc

Issue 7866019: New implementation of font precache on Windows. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update per code review Created 9 years, 3 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
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/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
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 rv = GetFontData(hdc, table, offset, buffer, length); 227 rv = GetFontData(hdc, table, offset, buffer, length);
228 UtilityThread::current()->Send(
229 new ChromeUtilityHostMsg_ReleaseCachedFonts());
230 }
228 } 231 }
229 } 232 }
230 return rv; 233 return rv;
231 } 234 }
232 235
233 bool ChromeContentUtilityClient::RenderPDFToWinMetafile( 236 bool ChromeContentUtilityClient::RenderPDFToWinMetafile(
234 base::PlatformFile pdf_file, 237 base::PlatformFile pdf_file,
235 const FilePath& metafile_path, 238 const FilePath& metafile_path,
236 const gfx::Rect& render_area, 239 const gfx::Rect& render_area,
237 int render_dpi, 240 int render_dpi,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded( 349 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded(
347 printer_name, printer_info)); 350 printer_name, printer_info));
348 } else { 351 } else {
349 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed( 352 Send(new ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed(
350 printer_name)); 353 printer_name));
351 } 354 }
352 UtilityThread::current()->ReleaseProcessIfNeeded(); 355 UtilityThread::current()->ReleaseProcessIfNeeded();
353 } 356 }
354 357
355 } // namespace chrome 358 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698