summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/npobject_proxy.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/npobject_proxy.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/npobject_proxy.cc')
-rw-r--r--chrome/plugin/npobject_proxy.cc36
1 files changed, 25 insertions, 11 deletions
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc
index f56832a..b7bca6b 100644
--- a/chrome/plugin/npobject_proxy.cc
+++ b/chrome/plugin/npobject_proxy.cc
@@ -49,11 +49,13 @@ NPObjectProxy::NPObjectProxy(
PluginChannelBase* channel,
int route_id,
intptr_t npobject_ptr,
- base::WaitableEvent* modal_dialog_event)
+ base::WaitableEvent* modal_dialog_event,
+ const GURL& page_url)
: channel_(channel),
route_id_(route_id),
npobject_ptr_(npobject_ptr),
- modal_dialog_event_(modal_dialog_event) {
+ modal_dialog_event_(modal_dialog_event),
+ page_url_(page_url) {
channel_->AddRoute(route_id, this, true);
}
@@ -68,11 +70,12 @@ NPObjectProxy::~NPObjectProxy() {
NPObject* NPObjectProxy::Create(PluginChannelBase* channel,
int route_id,
intptr_t npobject_ptr,
- base::WaitableEvent* modal_dialog_event) {
+ base::WaitableEvent* modal_dialog_event,
+ const GURL& page_url) {
NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>(
NPN_CreateObject(0, &npclass_proxy_));
obj->proxy = new NPObjectProxy(
- channel, route_id, npobject_ptr, modal_dialog_event);
+ channel, route_id, npobject_ptr, modal_dialog_event, page_url);
return reinterpret_cast<NPObject*>(obj);
}
@@ -166,7 +169,8 @@ bool NPObjectProxy::NPInvokePrivate(NPP npp,
for (unsigned int i = 0; i < arg_count; ++i) {
NPVariant_Param param;
CreateNPVariantParam(
- args[i], channel_copy, &param, false, proxy->modal_dialog_event_);
+ args[i], channel_copy, &param, false, proxy->modal_dialog_event_,
+ proxy->page_url_);
args_param.push_back(param);
}
@@ -184,6 +188,7 @@ bool NPObjectProxy::NPInvokePrivate(NPP npp,
base::WaitableEvent* modal_dialog_event_handle = proxy->modal_dialog_event_;
+ GURL page_url = proxy->page_url_;
proxy->Send(msg);
// Send may delete proxy.
@@ -193,7 +198,8 @@ bool NPObjectProxy::NPInvokePrivate(NPP npp,
return false;
CreateNPVariant(
- param_result, channel_copy, np_result, modal_dialog_event_handle);
+ param_result, channel_copy, np_result, modal_dialog_event_handle,
+ page_url);
return true;
}
@@ -243,6 +249,8 @@ bool NPObjectProxy::NPGetProperty(NPObject *obj,
NPVariant_Param param;
base::WaitableEvent* modal_dialog_event_handle = proxy->modal_dialog_event_;
scoped_refptr<PluginChannelBase> channel(proxy->channel_);
+
+ GURL page_url = proxy->page_url_;
proxy->Send(new NPObjectMsg_GetProperty(
proxy->route_id(), name_param, &param, &result));
// Send may delete proxy.
@@ -251,7 +259,7 @@ bool NPObjectProxy::NPGetProperty(NPObject *obj,
return false;
CreateNPVariant(
- param, channel.get(), np_result, modal_dialog_event_handle);
+ param, channel.get(), np_result, modal_dialog_event_handle, page_url);
return true;
}
@@ -271,7 +279,7 @@ bool NPObjectProxy::NPSetProperty(NPObject *obj,
NPVariant_Param value_param;
CreateNPVariantParam(
*value, proxy->channel(), &value_param, false,
- proxy->modal_dialog_event_);
+ proxy->modal_dialog_event_, proxy->page_url_);
proxy->Send(new NPObjectMsg_SetProperty(
proxy->route_id(), name_param, value_param, &result));
@@ -358,7 +366,8 @@ bool NPObjectProxy::NPNConstruct(NPObject *obj,
for (unsigned int i = 0; i < arg_count; ++i) {
NPVariant_Param param;
CreateNPVariantParam(
- args[i], channel_copy, &param, false, proxy->modal_dialog_event_);
+ args[i], channel_copy, &param, false, proxy->modal_dialog_event_,
+ proxy->page_url_);
args_param.push_back(param);
}
@@ -371,6 +380,7 @@ bool NPObjectProxy::NPNConstruct(NPObject *obj,
base::WaitableEvent* modal_dialog_event_handle = proxy->modal_dialog_event_;
+ GURL page_url = proxy->page_url_;
proxy->Send(msg);
// Send may delete proxy.
@@ -380,7 +390,8 @@ bool NPObjectProxy::NPNConstruct(NPObject *obj,
return false;
CreateNPVariant(
- param_result, channel_copy, np_result, modal_dialog_event_handle);
+ param_result, channel_copy, np_result, modal_dialog_event_handle,
+ page_url);
return true;
}
@@ -418,6 +429,8 @@ bool NPObjectProxy::NPNEvaluate(NPP npp,
msg->set_pump_messages_event(proxy->modal_dialog_event_);
scoped_refptr<PluginChannelBase> channel(proxy->channel_);
base::WaitableEvent* modal_dialog_event_handle = proxy->modal_dialog_event_;
+
+ GURL page_url = proxy->page_url_;
proxy->Send(msg);
// Send may delete proxy.
proxy = NULL;
@@ -425,7 +438,8 @@ bool NPObjectProxy::NPNEvaluate(NPP npp,
return false;
CreateNPVariant(
- result_param, channel.get(), result_var, modal_dialog_event_handle);
+ result_param, channel.get(), result_var, modal_dialog_event_handle,
+ page_url);
return true;
}