diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 03:24:06 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 03:24:06 +0000 |
commit | c1a6af48336ad3d215d04fac4ae79daf125b0a0e (patch) | |
tree | fbe13a70a9a8b3390fdf9817af058c365a1418a4 /chrome/renderer/render_process_impl.cc | |
parent | c77702cddb59dd0b6304ca2c46a72aeec7ee84b0 (diff) | |
download | chromium_src-c1a6af48336ad3d215d04fac4ae79daf125b0a0e.zip chromium_src-c1a6af48336ad3d215d04fac4ae79daf125b0a0e.tar.gz chromium_src-c1a6af48336ad3d215d04fac4ae79daf125b0a0e.tar.bz2 |
Checking in Lei's fix from http://codereview.chromium.org/2827024: Don't crash if the pdf plugin couldn't be loaded.
BUG=47362
TBR=thestig
Review URL: http://codereview.chromium.org/2852026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50814 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_process_impl.cc')
-rw-r--r-- | chrome/renderer/render_process_impl.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index 090317a..b1b6bc6 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -188,16 +188,18 @@ RenderProcessImpl::RenderProcessImpl() file_util::PathExists(pdf)) { static scoped_refptr<NPAPI::PluginLib> pdf_lib = NPAPI::PluginLib::CreatePluginLib(pdf); - bool rv = pdf_lib->EnsureAlwaysLoaded(); + bool rv = pdf_lib && pdf_lib->EnsureAlwaysLoaded(); DCHECK(rv) << "Couldn't load PDF plugin"; #if defined(OS_WIN) - g_iat_patch_createdca.Patch( - pdf_lib->plugin_info().path.value().c_str(), - "gdi32.dll", "CreateDCA", CreateDCAPatch); - g_iat_patch_get_font_data.Patch( - pdf_lib->plugin_info().path.value().c_str(), - "gdi32.dll", "GetFontData", GetFontDataPatch); + if (rv) { + g_iat_patch_createdca.Patch( + pdf_lib->plugin_info().path.value().c_str(), + "gdi32.dll", "CreateDCA", CreateDCAPatch); + g_iat_patch_get_font_data.Patch( + pdf_lib->plugin_info().path.value().c_str(), + "gdi32.dll", "GetFontData", GetFontDataPatch); + } #endif } #endif |