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

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

Issue 2799009: Don't check if the internal plugin exists when someone just asks for its path... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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_paths.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) 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 // TODO(hclam): Add more checks here. Currently this is not used. 178 // TODO(hclam): Add more checks here. Currently this is not used.
179 if (CommandLine::ForCurrentProcess()->HasSwitch( 179 if (CommandLine::ForCurrentProcess()->HasSwitch(
180 switches::kEnableOpenMax)) { 180 switches::kEnableOpenMax)) {
181 media::InitializeOpenMaxLibrary(module_path); 181 media::InitializeOpenMaxLibrary(module_path);
182 } 182 }
183 #endif 183 #endif
184 184
185 // Load the pdf plugin before the sandbox is turned on. 185 // Load the pdf plugin before the sandbox is turned on.
186 FilePath pdf; 186 FilePath pdf;
187 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf)) { 187 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) &&
188 file_util::PathExists(pdf)) {
188 static scoped_refptr<NPAPI::PluginLib> pdf_lib = 189 static scoped_refptr<NPAPI::PluginLib> pdf_lib =
189 NPAPI::PluginLib::CreatePluginLib(pdf); 190 NPAPI::PluginLib::CreatePluginLib(pdf);
190 // Load the plugin now before the sandbox engages and keep it always loaded. 191 // Load the plugin now before the sandbox engages and keep it always loaded.
191 pdf_lib->EnsureAlwaysLoaded(); 192 pdf_lib->EnsureAlwaysLoaded();
192 193
193 #if defined(OS_WIN) 194 #if defined(OS_WIN)
194 g_iat_patch_createdca.Patch( 195 g_iat_patch_createdca.Patch(
195 pdf_lib->plugin_info().path.value().c_str(), 196 pdf_lib->plugin_info().path.value().c_str(),
196 "gdi32.dll", "CreateDCA", CreateDCAPatch); 197 "gdi32.dll", "CreateDCA", CreateDCAPatch);
197 g_iat_patch_get_font_data.Patch( 198 g_iat_patch_get_font_data.Patch(
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 362 }
362 363
363 void RenderProcessImpl::ClearTransportDIBCache() { 364 void RenderProcessImpl::ClearTransportDIBCache() {
364 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 365 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
365 if (shared_mem_cache_[i]) { 366 if (shared_mem_cache_[i]) {
366 FreeTransportDIB(shared_mem_cache_[i]); 367 FreeTransportDIB(shared_mem_cache_[i]);
367 shared_mem_cache_[i] = NULL; 368 shared_mem_cache_[i] = NULL;
368 } 369 }
369 } 370 }
370 } 371 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698