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

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

Issue 1462001: Use internal pdf plugin with --internal-pdf (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/chrome_switches.cc ('k') | chrome/renderer/render_view.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <objidl.h> 9 #include <objidl.h>
10 #include <mlang.h> 10 #include <mlang.h>
(...skipping 15 matching lines...) Expand all
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/chrome_paths.h" 27 #include "chrome/common/chrome_paths.h"
28 #include "chrome/common/render_messages.h" 28 #include "chrome/common/render_messages.h"
29 #include "chrome/common/nacl_types.h" 29 #include "chrome/common/nacl_types.h"
30 #include "chrome/renderer/render_view.h" 30 #include "chrome/renderer/render_view.h"
31 #include "ipc/ipc_channel.h" 31 #include "ipc/ipc_channel.h"
32 #include "ipc/ipc_message_utils.h" 32 #include "ipc/ipc_message_utils.h"
33 #include "media/base/media.h" 33 #include "media/base/media.h"
34 #include "media/base/media_switches.h" 34 #include "media/base/media_switches.h"
35 #include "native_client/src/trusted/plugin/nacl_entry_points.h" 35 #include "native_client/src/trusted/plugin/nacl_entry_points.h"
36 #include "webkit/glue/plugins/plugin_instance.h"
37 #include "webkit/glue/plugins/plugin_lib.h"
36 #include "webkit/glue/webkit_glue.h" 38 #include "webkit/glue/webkit_glue.h"
37 39
38 #if defined(OS_MACOSX) 40 #if defined(OS_MACOSX)
39 #include "base/mac_util.h" 41 #include "base/mac_util.h"
40 #endif 42 #endif
41 43
42 namespace { 44 namespace {
43 45
44 bool LaunchNaClProcess(const char* url, 46 bool LaunchNaClProcess(const char* url,
45 int imc_fd, 47 int imc_fd,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 initialized_media_library_ = 134 initialized_media_library_ =
133 PathService::Get(base::DIR_MODULE, &module_path) && 135 PathService::Get(base::DIR_MODULE, &module_path) &&
134 media::InitializeMediaLibrary(module_path); 136 media::InitializeMediaLibrary(module_path);
135 137
136 // TODO(hclam): Add more checks here. Currently this is not used. 138 // TODO(hclam): Add more checks here. Currently this is not used.
137 if (CommandLine::ForCurrentProcess()->HasSwitch( 139 if (CommandLine::ForCurrentProcess()->HasSwitch(
138 switches::kEnableOpenMax)) { 140 switches::kEnableOpenMax)) {
139 media::InitializeOpenMaxLibrary(module_path); 141 media::InitializeOpenMaxLibrary(module_path);
140 } 142 }
141 #endif 143 #endif
144
145 // Load the pdf plugin before the sandbox is turned on.
146 FilePath pdf;
147 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf)) {
148 static scoped_refptr<NPAPI::PluginLib> pdf_lib =
149 NPAPI::PluginLib::CreatePluginLib(pdf);
150 // Actually load the plugin.
151 pdf_lib->NP_Initialize();
152 // Keep an instance around to prevent the plugin unloading after a pdf is
153 // closed.
154 // Don't use scoped_ptr here because then get asserts on process shut down
155 // when running in --single-process.
156 static NPAPI::PluginInstance* instance = pdf_lib->CreateInstance("");
157 instance->plugin_lib(); // Quiet unused variable warnings in gcc.
158 }
142 } 159 }
143 160
144 RenderProcessImpl::~RenderProcessImpl() { 161 RenderProcessImpl::~RenderProcessImpl() {
145 // TODO(port): Try and limit what we pull in for our non-Win unit test bundle. 162 // TODO(port): Try and limit what we pull in for our non-Win unit test bundle.
146 #ifndef NDEBUG 163 #ifndef NDEBUG
147 // log important leaked objects 164 // log important leaked objects
148 webkit_glue::CheckForLeaks(); 165 webkit_glue::CheckForLeaks();
149 #endif 166 #endif
150 167
151 GetShutDownEvent()->Signal(); 168 GetShutDownEvent()->Signal();
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 318 }
302 319
303 void RenderProcessImpl::ClearTransportDIBCache() { 320 void RenderProcessImpl::ClearTransportDIBCache() {
304 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 321 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
305 if (shared_mem_cache_[i]) { 322 if (shared_mem_cache_[i]) {
306 FreeTransportDIB(shared_mem_cache_[i]); 323 FreeTransportDIB(shared_mem_cache_[i]);
307 shared_mem_cache_[i] = NULL; 324 shared_mem_cache_[i] = NULL;
308 } 325 }
309 } 326 }
310 } 327 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | chrome/renderer/render_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698