diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 20:16:38 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-08 20:16:38 +0000 |
commit | ce185864d3ef3d2a3fd40ae93300a5858f961c94 (patch) | |
tree | c8a6e9f9fc755f872cdc1f384148296a81bfc501 /chrome/plugin | |
parent | 09f83fa89c9ab23b5f9623b06f1322850d21a15a (diff) | |
download | chromium_src-ce185864d3ef3d2a3fd40ae93300a5858f961c94.zip chromium_src-ce185864d3ef3d2a3fd40ae93300a5858f961c94.tar.gz chromium_src-ce185864d3ef3d2a3fd40ae93300a5858f961c94.tar.bz2 |
Revert change 20173 because it breaks the ui_tests, plugin_tests
and most likely some page cyclers.
Review URL: http://codereview.chromium.org/155236
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/npobject_proxy.cc | 31 | ||||
-rw-r--r-- | chrome/plugin/npobject_proxy.h | 10 | ||||
-rw-r--r-- | chrome/plugin/npobject_stub.cc | 28 | ||||
-rw-r--r-- | chrome/plugin/npobject_stub.h | 7 | ||||
-rw-r--r-- | chrome/plugin/npobject_util.cc | 12 | ||||
-rw-r--r-- | chrome/plugin/npobject_util.h | 13 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 14 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.h | 5 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 21 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.h | 6 |
10 files changed, 44 insertions, 103 deletions
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc index acb3cc5..f56832a 100644 --- a/chrome/plugin/npobject_proxy.cc +++ b/chrome/plugin/npobject_proxy.cc @@ -49,13 +49,11 @@ NPObjectProxy::NPObjectProxy( PluginChannelBase* channel, int route_id, intptr_t npobject_ptr, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url) + base::WaitableEvent* modal_dialog_event) : channel_(channel), route_id_(route_id), npobject_ptr_(npobject_ptr), - modal_dialog_event_(modal_dialog_event), - page_url_(page_url) { + modal_dialog_event_(modal_dialog_event) { channel_->AddRoute(route_id, this, true); } @@ -70,12 +68,11 @@ NPObjectProxy::~NPObjectProxy() { NPObject* NPObjectProxy::Create(PluginChannelBase* channel, int route_id, intptr_t npobject_ptr, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url) { + base::WaitableEvent* modal_dialog_event) { NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>( NPN_CreateObject(0, &npclass_proxy_)); obj->proxy = new NPObjectProxy( - channel, route_id, npobject_ptr, modal_dialog_event, page_url); + channel, route_id, npobject_ptr, modal_dialog_event); return reinterpret_cast<NPObject*>(obj); } @@ -169,8 +166,7 @@ bool NPObjectProxy::NPInvokePrivate(NPP npp, for (unsigned int i = 0; i < arg_count; ++i) { NPVariant_Param param; CreateNPVariantParam( - args[i], channel_copy, ¶m, false, proxy->modal_dialog_event_, - proxy->page_url_); + args[i], channel_copy, ¶m, false, proxy->modal_dialog_event_); args_param.push_back(param); } @@ -197,8 +193,7 @@ bool NPObjectProxy::NPInvokePrivate(NPP npp, return false; CreateNPVariant( - param_result, channel_copy, np_result, modal_dialog_event_handle, - proxy->page_url_); + param_result, channel_copy, np_result, modal_dialog_event_handle); return true; } @@ -256,8 +251,7 @@ bool NPObjectProxy::NPGetProperty(NPObject *obj, return false; CreateNPVariant( - param, channel.get(), np_result, modal_dialog_event_handle, - proxy->page_url_); + param, channel.get(), np_result, modal_dialog_event_handle); return true; } @@ -277,7 +271,7 @@ bool NPObjectProxy::NPSetProperty(NPObject *obj, NPVariant_Param value_param; CreateNPVariantParam( *value, proxy->channel(), &value_param, false, - proxy->modal_dialog_event_, proxy->page_url_); + proxy->modal_dialog_event_); proxy->Send(new NPObjectMsg_SetProperty( proxy->route_id(), name_param, value_param, &result)); @@ -364,8 +358,7 @@ bool NPObjectProxy::NPNConstruct(NPObject *obj, for (unsigned int i = 0; i < arg_count; ++i) { NPVariant_Param param; CreateNPVariantParam( - args[i], channel_copy, ¶m, false, proxy->modal_dialog_event_, - proxy->page_url_); + args[i], channel_copy, ¶m, false, proxy->modal_dialog_event_); args_param.push_back(param); } @@ -387,8 +380,7 @@ bool NPObjectProxy::NPNConstruct(NPObject *obj, return false; CreateNPVariant( - param_result, channel_copy, np_result, modal_dialog_event_handle, - proxy->page_url_); + param_result, channel_copy, np_result, modal_dialog_event_handle); return true; } @@ -433,8 +425,7 @@ bool NPObjectProxy::NPNEvaluate(NPP npp, return false; CreateNPVariant( - result_param, channel.get(), result_var, modal_dialog_event_handle, - proxy->page_url_); + result_param, channel.get(), result_var, modal_dialog_event_handle); return true; } diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h index afeb207..3cdae9e 100644 --- a/chrome/plugin/npobject_proxy.h +++ b/chrome/plugin/npobject_proxy.h @@ -10,7 +10,6 @@ #include "base/ref_counted.h" #include "chrome/common/ipc_channel.h" -#include "googleurl/src/gurl.h" #include "third_party/npapi/bindings/npruntime.h" class PluginChannelBase; @@ -37,8 +36,7 @@ class NPObjectProxy : public IPC::Channel::Listener, static NPObject* Create(PluginChannelBase* channel, int route_id, intptr_t npobject_ptr, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url); + base::WaitableEvent* modal_dialog_event); // IPC::Message::Sender implementation: bool Send(IPC::Message* msg); @@ -103,8 +101,7 @@ class NPObjectProxy : public IPC::Channel::Listener, NPObjectProxy(PluginChannelBase* channel, int route_id, intptr_t npobject_ptr, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url); + base::WaitableEvent* modal_dialog_event); // IPC::Channel::Listener implementation: void OnMessageReceived(const IPC::Message& msg); @@ -121,9 +118,6 @@ class NPObjectProxy : public IPC::Channel::Listener, int route_id_; intptr_t npobject_ptr_; base::WaitableEvent* modal_dialog_event_; - - // The url of the main frame hosting the plugin. - GURL page_url_; }; #endif // CHROME_PLUGIN_NPOBJECT_PROXY_H_ diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc index 4345d37..c5f14f5 100644 --- a/chrome/plugin/npobject_stub.cc +++ b/chrome/plugin/npobject_stub.cc @@ -4,7 +4,6 @@ #include "chrome/plugin/npobject_stub.h" -#include "chrome/common/child_process_logging.h" #include "chrome/common/plugin_messages.h" #include "chrome/plugin/npobject_util.h" #include "chrome/plugin/plugin_channel_base.h" @@ -16,15 +15,13 @@ NPObjectStub::NPObjectStub( NPObject* npobject, PluginChannelBase* channel, int route_id, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url) + base::WaitableEvent* modal_dialog_event) : npobject_(npobject), channel_(channel), route_id_(route_id), valid_(true), web_plugin_delegate_proxy_(NULL), - modal_dialog_event_(modal_dialog_event), - page_url_(page_url) { + modal_dialog_event_(modal_dialog_event) { channel_->AddRoute(route_id, this, true); // We retain the object just as PluginHost does if everything was in-process. @@ -45,8 +42,6 @@ bool NPObjectStub::Send(IPC::Message* msg) { } void NPObjectStub::OnMessageReceived(const IPC::Message& msg) { - child_process_logging::ScopedActiveURLSetter url_setter(page_url_); - if (!valid_) { if (msg.is_sync()) { // The object could be garbage because the frame has gone away, so @@ -122,8 +117,7 @@ void NPObjectStub::OnInvoke(bool is_default, NPVariant* args_var = new NPVariant[arg_count]; for (int i = 0; i < arg_count; ++i) { CreateNPVariant( - args[i], local_channel, &(args_var[i]), modal_dialog_event_, - page_url_); + args[i], local_channel, &(args_var[i]), modal_dialog_event_); } if (is_default) { @@ -159,8 +153,7 @@ void NPObjectStub::OnInvoke(bool is_default, delete[] args_var; CreateNPVariantParam( - result_var, local_channel, &result_param, true, modal_dialog_event_, - page_url_); + result_var, local_channel, &result_param, true, modal_dialog_event_); NPObjectMsg_Invoke::WriteReplyParams(reply_msg, result_param, return_value); local_channel->Send(reply_msg); } @@ -197,7 +190,7 @@ void NPObjectStub::OnGetProperty(const NPIdentifier_Param& name, } CreateNPVariantParam( - result_var, channel_, property, true, modal_dialog_event_, page_url_); + result_var, channel_, property, true, modal_dialog_event_); } void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, @@ -207,8 +200,7 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, VOID_TO_NPVARIANT(result_var); NPIdentifier id = CreateNPIdentifier(name); NPVariant property_var; - CreateNPVariant( - property, channel_, &property_var, modal_dialog_event_, page_url_); + CreateNPVariant(property, channel_, &property_var, modal_dialog_event_); if (IsPluginProcess()) { if (npobject_->_class->setProperty) { @@ -289,7 +281,7 @@ void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args, NPVariant* args_var = new NPVariant[arg_count]; for (int i = 0; i < arg_count; ++i) { CreateNPVariant( - args[i], local_channel, &(args_var[i]), modal_dialog_event_, page_url_); + args[i], local_channel, &(args_var[i]), modal_dialog_event_); } if (IsPluginProcess()) { @@ -310,8 +302,7 @@ void NPObjectStub::OnConstruct(const std::vector<NPVariant_Param>& args, delete[] args_var; CreateNPVariantParam( - result_var, local_channel, &result_param, true, modal_dialog_event_, - page_url_); + result_var, local_channel, &result_param, true, modal_dialog_event_); NPObjectMsg_Invoke::WriteReplyParams(reply_msg, result_param, return_value); local_channel->Send(reply_msg); } @@ -340,8 +331,7 @@ void NPObjectStub::OnEvaluate(const std::string& script, NPVariant_Param result_param; CreateNPVariantParam( - result_var, local_channel, &result_param, true, modal_dialog_event_, - page_url_); + result_var, local_channel, &result_param, true, modal_dialog_event_); NPObjectMsg_Evaluate::WriteReplyParams(reply_msg, result_param, return_value); local_channel->Send(reply_msg); } diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h index acfd7727..94bf2b1 100644 --- a/chrome/plugin/npobject_stub.h +++ b/chrome/plugin/npobject_stub.h @@ -12,7 +12,6 @@ #include "base/ref_counted.h" #include "chrome/common/ipc_channel.h" -#include "googleurl/src/gurl.h" namespace base { class WaitableEvent; @@ -33,8 +32,7 @@ class NPObjectStub : public IPC::Channel::Listener, NPObjectStub(NPObject* npobject, PluginChannelBase* channel, int route_id, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url); + base::WaitableEvent* modal_dialog_event); ~NPObjectStub(); // IPC::Message::Sender implementation: @@ -92,9 +90,6 @@ class NPObjectStub : public IPC::Channel::Listener, WebPluginDelegateProxy* web_plugin_delegate_proxy_; base::WaitableEvent* modal_dialog_event_; - - // The url of the main frame hosting the plugin. - GURL page_url_; }; #endif // CHROME_PLUGIN_NPOBJECT_STUB_H_ diff --git a/chrome/plugin/npobject_util.cc b/chrome/plugin/npobject_util.cc index ecf5606..ececfa2 100644 --- a/chrome/plugin/npobject_util.cc +++ b/chrome/plugin/npobject_util.cc @@ -138,8 +138,7 @@ void CreateNPVariantParam(const NPVariant& variant, PluginChannelBase* channel, NPVariant_Param* param, bool release, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url) { + base::WaitableEvent* modal_dialog_event) { switch (variant.type) { case NPVariantType_Void: param->type = NPVARIANT_PARAM_VOID; @@ -184,8 +183,7 @@ void CreateNPVariantParam(const NPVariant& variant, param->type = NPVARIANT_PARAM_OBJECT_ROUTING_ID; int route_id = channel->GenerateRouteID(); new NPObjectStub( - variant.value.objectValue, channel, route_id, modal_dialog_event, - page_url); + variant.value.objectValue, channel, route_id, modal_dialog_event); param->npobject_routing_id = route_id; param->npobject_pointer = reinterpret_cast<intptr_t>(variant.value.objectValue); @@ -206,8 +204,7 @@ void CreateNPVariantParam(const NPVariant& variant, void CreateNPVariant(const NPVariant_Param& param, PluginChannelBase* channel, NPVariant* result, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url) { + base::WaitableEvent* modal_dialog_event) { switch (param.type) { case NPVARIANT_PARAM_VOID: result->type = NPVariantType_Void; @@ -240,8 +237,7 @@ void CreateNPVariant(const NPVariant_Param& param, NPObjectProxy::Create(channel, param.npobject_routing_id, param.npobject_pointer, - modal_dialog_event, - page_url); + modal_dialog_event); break; case NPVARIANT_PARAM_OBJECT_POINTER: result->type = NPVariantType_Object; diff --git a/chrome/plugin/npobject_util.h b/chrome/plugin/npobject_util.h index 861d591..9a2907b 100644 --- a/chrome/plugin/npobject_util.h +++ b/chrome/plugin/npobject_util.h @@ -15,15 +15,12 @@ #include "chrome/plugin/npobject_stub.h" -class GURL; +struct _NPVariant; +typedef _NPVariant NPVariant; class NPObjectProxy; class PluginChannelBase; - -struct _NPVariant; struct NPIdentifier_Param; struct NPVariant_Param; - -typedef _NPVariant NPVariant; typedef void *NPIdentifier; namespace base { @@ -53,15 +50,13 @@ void CreateNPVariantParam(const NPVariant& variant, PluginChannelBase* channel, NPVariant_Param* param, bool release, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url); + base::WaitableEvent* modal_dialog_event); // Creates an NPVariant from the marshalled object. void CreateNPVariant(const NPVariant_Param& param, PluginChannelBase* channel, NPVariant* result, - base::WaitableEvent* modal_dialog_event, - const GURL& page_url); + base::WaitableEvent* modal_dialog_event); #if defined(OS_WIN) // Given a plugin's HWND, returns an event associated with the TabContents diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 4d18012..3bfd002 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -7,7 +7,6 @@ #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" @@ -50,8 +49,6 @@ 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. @@ -67,8 +64,6 @@ 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. @@ -115,9 +110,6 @@ 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())) { @@ -147,8 +139,7 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, delegate_ = WebPluginDelegate::Create(path, mime_type_, parent); if (delegate_) { - webplugin_ = new WebPluginProxy( - channel_, instance_id_, delegate_, page_url_); + webplugin_ = new WebPluginProxy(channel_, instance_id_, delegate_); #if defined(OS_WIN) if (!webplugin_->SetModalDialogEvent(params.modal_dialog_event)) return; @@ -287,8 +278,7 @@ 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(), - page_url_); + object, channel_.get(), *route_id, webplugin_->modal_dialog_event()); // Release ref added by GetPluginScriptableObject (our stub holds its own). NPN_ReleaseObject(object); diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 10ac7a4..b09038c 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -13,9 +13,9 @@ #include "base/task.h" #include "chrome/common/ipc_channel.h" #include "chrome/common/transport_dib.h" -#include "googleurl/src/gurl.h" #include "third_party/npapi/bindings/npapi.h" +class GURL; class PluginChannel; class WebPluginProxy; class WebPluginDelegate; @@ -105,9 +105,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, WebPluginDelegate* delegate_; WebPluginProxy* webplugin_; - // The url of the main frame hosting the plugin. - GURL page_url_; - DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); }; diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index b2fe778..3d6a6ac 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -13,7 +13,6 @@ #include "base/singleton.h" #include "base/waitable_event.h" #include "build/build_config.h" -#include "chrome/common/child_process_logging.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/url_constants.h" #include "chrome/plugin/npobject_proxy.h" @@ -36,8 +35,7 @@ static ContextMap& GetContextMap() { WebPluginProxy::WebPluginProxy( PluginChannel* channel, int route_id, - WebPluginDelegate* delegate, - const GURL& page_url) + WebPluginDelegate* delegate) : channel_(channel), route_id_(route_id), cp_browsing_context_(0), @@ -45,7 +43,6 @@ WebPluginProxy::WebPluginProxy( plugin_element_(NULL), delegate_(delegate), waiting_for_paint_(false), - page_url_(page_url), ALLOW_THIS_IN_INITIALIZER_LIST(runnable_method_factory_(this)) { } @@ -162,9 +159,10 @@ NPObject* WebPluginProxy::GetWindowScriptNPObject() { if (!success) return NULL; - window_npobject_ = NPObjectProxy::Create( - channel_, npobject_route_id, npobject_ptr, modal_dialog_event_.get(), - page_url_); + window_npobject_ = NPObjectProxy::Create(channel_, + npobject_route_id, + npobject_ptr, + modal_dialog_event_.get()); return window_npobject_; } @@ -181,9 +179,10 @@ NPObject* WebPluginProxy::GetPluginElement() { if (!success) return NULL; - plugin_element_ = NPObjectProxy::Create( - channel_, npobject_route_id, npobject_ptr, modal_dialog_event_.get(), - page_url_); + plugin_element_ = NPObjectProxy::Create(channel_, + npobject_route_id, + npobject_ptr, + modal_dialog_event_.get()); return plugin_element_; } @@ -519,8 +518,6 @@ void WebPluginProxy::InitiateHTTPRangeRequest(const char* url, } void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { - child_process_logging::ScopedActiveURLSetter url_setter(page_url_); - Paint(damaged_rect); Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); } diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 103be5c..0388514 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -16,7 +16,6 @@ #include "chrome/common/ipc_message.h" #include "chrome/common/chrome_plugin_api.h" #include "chrome/common/transport_dib.h" -#include "googleurl/src/gurl.h" #include "webkit/glue/webplugin.h" namespace base { @@ -34,8 +33,7 @@ class WebPluginProxy : public WebPlugin { // marshalled WebPlugin calls. WebPluginProxy(PluginChannel* channel, int route_id, - WebPluginDelegate* delegate, - const GURL& page_url); + WebPluginDelegate* delegate); ~WebPluginProxy(); // WebPlugin overrides @@ -158,8 +156,6 @@ class WebPluginProxy : public WebPlugin { gfx::Rect damaged_rect_; bool waiting_for_paint_; scoped_ptr<base::WaitableEvent> modal_dialog_event_; - // The url of the main frame hosting the plugin. - GURL page_url_; #if defined(OS_WIN) // Variables used for desynchronized windowless plugin painting. See note in |