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

Side by Side Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 854773002: Fix font loading in OOP PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 11 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
« no previous file with comments | « no previous file | content/ppapi_plugin/ppapi_thread.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/chrome_render_process_observer.h" 5 #include "chrome/renderer/chrome_render_process_observer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/allocator/allocator_extension.h" 10 #include "base/allocator/allocator_extension.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 RenderThread* thread = RenderThread::Get(); 276 RenderThread* thread = RenderThread::Get();
277 resource_delegate_.reset(new RendererResourceDelegate()); 277 resource_delegate_.reset(new RendererResourceDelegate());
278 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); 278 thread->SetResourceDispatcherDelegate(resource_delegate_.get());
279 279
280 // Configure modules that need access to resources. 280 // Configure modules that need access to resources.
281 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); 281 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider);
282 282
283 #if defined(OS_WIN) 283 #if defined(OS_WIN)
284 // Need to patch a few functions for font loading to work correctly. 284 // TODO(scottmg): http://crbug.com/448473. This code should be removed once
285 base::FilePath pdf; 285 // PDF is always OOP and/or PDF is made to use Skia instead of GDI directly.
286 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && 286 if (!command_line.HasSwitch(switches::kEnableOutOfProcessPdf)) {
287 base::PathExists(pdf)) { 287 // Need to patch a few functions for font loading to work correctly.
288 g_iat_patch_createdca.Patch( 288 base::FilePath pdf;
289 pdf.value().c_str(), "gdi32.dll", "CreateDCA", CreateDCAPatch); 289 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) &&
290 g_iat_patch_get_font_data.Patch( 290 base::PathExists(pdf)) {
291 pdf.value().c_str(), "gdi32.dll", "GetFontData", GetFontDataPatch); 291 g_iat_patch_createdca.Patch(pdf.value().c_str(), "gdi32.dll", "CreateDCA",
292 CreateDCAPatch);
293 g_iat_patch_get_font_data.Patch(pdf.value().c_str(), "gdi32.dll",
294 "GetFontData", GetFontDataPatch);
295 }
292 } 296 }
293 #endif 297 #endif
294 298
295 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) 299 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS)
296 // On platforms where we use system NSS shared libraries, 300 // On platforms where we use system NSS shared libraries,
297 // initialize NSS now because it won't be able to load the .so's 301 // initialize NSS now because it won't be able to load the .so's
298 // after we engage the sandbox. 302 // after we engage the sandbox.
299 if (!command_line.HasSwitch(switches::kSingleProcess)) 303 if (!command_line.HasSwitch(switches::kSingleProcess))
300 crypto::InitNSSSafely(); 304 crypto::InitNSSSafely();
301 #elif defined(OS_WIN) 305 #elif defined(OS_WIN)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 382 }
379 383
380 void ChromeRenderProcessObserver::OnGetV8HeapStats() { 384 void ChromeRenderProcessObserver::OnGetV8HeapStats() {
381 HeapStatisticsCollector::Instance()->InitiateCollection(); 385 HeapStatisticsCollector::Instance()->InitiateCollection();
382 } 386 }
383 387
384 const RendererContentSettingRules* 388 const RendererContentSettingRules*
385 ChromeRenderProcessObserver::content_setting_rules() const { 389 ChromeRenderProcessObserver::content_setting_rules() const {
386 return &content_setting_rules_; 390 return &content_setting_rules_;
387 } 391 }
OLDNEW
« no previous file with comments | « no previous file | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698