summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 10:38:20 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 10:38:20 +0000
commit94752ee35e6db8519d3bf1349e0953ef38abcd9c (patch)
treec8e661e86b8030d870145b6a85e574a451450f66
parent65deb3f9804b405e33701b3f92974523de617647 (diff)
downloadchromium_src-94752ee35e6db8519d3bf1349e0953ef38abcd9c.zip
chromium_src-94752ee35e6db8519d3bf1349e0953ef38abcd9c.tar.gz
chromium_src-94752ee35e6db8519d3bf1349e0953ef38abcd9c.tar.bz2
Add error messages when plug-in loading fails.
This is to debug the randomly-appearing "Missing Plug-in" messages. BUG=112185 TEST=none Review URL: http://codereview.chromium.org/9365022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121422 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/render_view_impl.cc4
-rw-r--r--content/renderer/webplugin_delegate_proxy.cc13
-rw-r--r--webkit/plugins/npapi/webplugin_delegate_impl.cc10
-rw-r--r--webkit/plugins/npapi/webplugin_impl.cc11
4 files changed, 29 insertions, 9 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 8240f49..aa61f8c 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3499,8 +3499,10 @@ void RenderViewImpl::LoadURLExternally(
webkit::npapi::WebPluginDelegate* RenderViewImpl::CreatePluginDelegate(
const FilePath& file_path,
const std::string& mime_type) {
- if (!PluginChannelHost::IsListening())
+ if (!PluginChannelHost::IsListening()) {
+ LOG(ERROR) << "PluginChannelHost isn't listening";
return NULL;
+ }
bool in_process_plugin = RenderProcess::current()->UseInProcessPlugins();
if (in_process_plugin) {
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index 890003c..ca04b66 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -283,25 +283,31 @@ bool WebPluginDelegateProxy::Initialize(
// plugin crashed on initialization.
if (!info_.path.empty()) {
render_view_->PluginCrashed(info_.path);
+ LOG(ERROR) << "Plug-in crashed on start";
// Return true so that the plugin widget is created and we can paint the
// crashed plugin there.
return true;
}
+ LOG(ERROR) << "Plug-in couldn't be found";
return false;
}
scoped_refptr<PluginChannelHost> channel_host(
PluginChannelHost::GetPluginChannelHost(
channel_handle, ChildProcess::current()->io_message_loop_proxy()));
- if (!channel_host.get())
+ if (!channel_host.get()) {
+ LOG(ERROR) << "Couldn't get PluginChannelHost";
return false;
+ }
int instance_id;
bool result = channel_host->Send(new PluginMsg_CreateInstance(
mime_type_, &instance_id));
- if (!result)
+ if (!result) {
+ LOG(ERROR) << "Couldn't send PluginMsg_CreateInstance";
return false;
+ }
channel_host_ = channel_host;
instance_id_ = instance_id;
@@ -337,6 +343,9 @@ bool WebPluginDelegateProxy::Initialize(
IPC::Message* msg = new PluginMsg_Init(instance_id_, params, &result);
Send(msg);
+ if (!result)
+ LOG(ERROR) << "PluginMsg_Init returned false";
+
render_view_->RegisterPluginDelegate(this);
return result;
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.cc b/webkit/plugins/npapi/webplugin_delegate_impl.cc
index 04f2193..c2c7697 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl.cc
+++ b/webkit/plugins/npapi/webplugin_delegate_impl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -88,13 +88,17 @@ bool WebPluginDelegateImpl::Initialize(
creation_succeeded_ = instance_->Start(
url, argn.get(), argv.get(), argc, load_manually);
- if (!creation_succeeded_)
+ if (!creation_succeeded_) {
+ VLOG(1) << "Couldn't start plug-in instance";
return false;
+ }
windowless_ = instance_->windowless();
if (!windowless_) {
- if (!WindowedCreatePlugin())
+ if (!WindowedCreatePlugin()) {
+ VLOG(1) << "Couldn't create windowed plug-in";
return false;
+ }
} else {
// For windowless plugins we should set the containing window handle
// as the instance window handle. This is what Safari does. Not having
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index 4049596..3fe5d1f 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -247,13 +247,17 @@ struct WebPluginImpl::ClientInfo {
};
bool WebPluginImpl::initialize(WebPluginContainer* container) {
- if (!page_delegate_)
+ if (!page_delegate_) {
+ LOG(ERROR) << "No page delegate";
return false;
+ }
WebPluginDelegate* plugin_delegate = page_delegate_->CreatePluginDelegate(
file_path_, mime_type_);
- if (!plugin_delegate)
+ if (!plugin_delegate) {
+ LOG(ERROR) << "Couldn't create plug-in delegate";
return false;
+ }
// Set the container before Initialize because the plugin may
// synchronously call NPN_GetValue to get its container during its
@@ -262,6 +266,7 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) {
bool ok = plugin_delegate->Initialize(
plugin_url_, arg_names_, arg_values_, this, load_manually_);
if (!ok) {
+ LOG(ERROR) << "Couldn't initialize plug-in";
plugin_delegate->PluginDestroyed();
return false;
}