summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/npobject_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/plugin/npobject_proxy.cc')
-rw-r--r--chrome/plugin/npobject_proxy.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc
index f56832a..acb3cc5 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);
}
@@ -193,7 +197,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,
+ proxy->page_url_);
return true;
}
@@ -251,7 +256,8 @@ 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,
+ proxy->page_url_);
return true;
}
@@ -271,7 +277,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 +364,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);
}
@@ -380,7 +387,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,
+ proxy->page_url_);
return true;
}
@@ -425,7 +433,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,
+ proxy->page_url_);
return true;
}