summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/webplugin_delegate_stub.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 21:40:55 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 21:40:55 +0000
commitef9162785c55957324e72f737bb9b6b2406053dd (patch)
treed8c4b934a957eff37caffa911c91066fe27e04fb /chrome/plugin/webplugin_delegate_stub.cc
parent9e6f8526f9a60410b6d448103a9015d72a067deb (diff)
downloadchromium_src-ef9162785c55957324e72f737bb9b6b2406053dd.zip
chromium_src-ef9162785c55957324e72f737bb9b6b2406053dd.tar.gz
chromium_src-ef9162785c55957324e72f737bb9b6b2406053dd.tar.bz2
Add the page url to plugin crashes to aid debugging.
Review URL: http://codereview.chromium.org/155238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/webplugin_delegate_stub.cc')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 3bfd002..4d18012 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "base/command_line.h"
+#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/plugin/npobject_stub.h"
@@ -49,6 +50,8 @@ WebPluginDelegateStub::WebPluginDelegateStub(
}
WebPluginDelegateStub::~WebPluginDelegateStub() {
+ child_process_logging::ScopedActiveURLSetter url_setter(page_url_);
+
if (channel_->in_send()) {
// The delegate or an npobject is in the callstack, so don't delete it
// right away.
@@ -64,6 +67,8 @@ WebPluginDelegateStub::~WebPluginDelegateStub() {
}
void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
+ child_process_logging::ScopedActiveURLSetter url_setter(page_url_);
+
// A plugin can execute a script to delete itself in any of its NPP methods.
// Hold an extra reference to ourself so that if this does occur and we're
// handling a sync message, we don't crash when attempting to send a reply.
@@ -110,6 +115,9 @@ bool WebPluginDelegateStub::Send(IPC::Message* msg) {
void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
bool* result) {
+ page_url_ = params.page_url;
+ child_process_logging::ScopedActiveURLSetter url_setter(page_url_);
+
*result = false;
int argc = static_cast<int>(params.arg_names.size());
if (argc != static_cast<int>(params.arg_values.size())) {
@@ -139,7 +147,8 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
delegate_ = WebPluginDelegate::Create(path, mime_type_, parent);
if (delegate_) {
- webplugin_ = new WebPluginProxy(channel_, instance_id_, delegate_);
+ webplugin_ = new WebPluginProxy(
+ channel_, instance_id_, delegate_, page_url_);
#if defined(OS_WIN)
if (!webplugin_->SetModalDialogEvent(params.modal_dialog_event))
return;
@@ -278,7 +287,8 @@ void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id,
// The stub will delete itself when the proxy tells it that it's released, or
// otherwise when the channel is closed.
new NPObjectStub(
- object, channel_.get(), *route_id, webplugin_->modal_dialog_event());
+ object, channel_.get(), *route_id, webplugin_->modal_dialog_event(),
+ page_url_);
// Release ref added by GetPluginScriptableObject (our stub holds its own).
NPN_ReleaseObject(object);