summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc16
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h7
-rw-r--r--chrome/plugin/webplugin_proxy.cc5
-rw-r--r--chrome/plugin/webplugin_proxy.h20
4 files changed, 31 insertions, 17 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index fda6909..65bdfdc 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -25,6 +25,9 @@
using WebKit::WebBindings;
using WebKit::WebCursorInfo;
+using webkit_glue::WebPlugin;
+using webkit_glue::WebPluginDelegate;
+using webkit_glue::WebPluginResourceClient;
class FinishDestructionTask : public Task {
public:
@@ -152,15 +155,16 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
// PluginThread::current()->Send(new PluginProcessHostMsg_MapNativeViewId(
// params.containing_window, &parent));
#endif
- delegate_ = WebPluginDelegate::Create(path, mime_type_, parent);
- if (delegate_) {
- webplugin_ = new WebPluginProxy(
- channel_, instance_id_, delegate_, page_url_);
+ webplugin_ = new WebPluginProxy(channel_, instance_id_, page_url_);
#if defined(OS_WIN)
- if (!webplugin_->SetModalDialogEvent(params.modal_dialog_event))
- return;
+ if (!webplugin_->SetModalDialogEvent(params.modal_dialog_event))
+ return;
#endif
+
+ delegate_ = WebPluginDelegate::Create(path, mime_type_, parent);
+ if (delegate_) {
+ webplugin_->set_delegate(delegate_);
*result = delegate_->Initialize(
params.url, argn, argv, argc, webplugin_, params.load_manually);
}
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index d0c6542..34cde08 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -18,7 +18,6 @@
class PluginChannel;
class WebPluginProxy;
-class WebPluginDelegate;
struct PluginMsg_Init_Params;
struct PluginMsg_DidReceiveResponseParams;
struct PluginMsg_URLRequestReply_Params;
@@ -28,6 +27,10 @@ namespace WebKit {
class WebInputEvent;
}
+namespace webkit_glue {
+class WebPluginDelegate;
+}
+
// Converts the IPC messages from WebPluginDelegateProxy into calls to the
// actual WebPluginDelegate object.
class WebPluginDelegateStub : public IPC::Channel::Listener,
@@ -99,7 +102,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
scoped_refptr<PluginChannel> channel_;
- WebPluginDelegate* delegate_;
+ webkit_glue::WebPluginDelegate* delegate_;
WebPluginProxy* webplugin_;
// The url of the main frame hosting the plugin.
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 1684785..739fc74 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -34,6 +34,8 @@
#endif
using WebKit::WebBindings;
+using webkit_glue::WebPluginDelegate;
+using webkit_glue::WebPluginResourceClient;
typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap;
static ContextMap& GetContextMap() {
@@ -43,14 +45,13 @@ static ContextMap& GetContextMap() {
WebPluginProxy::WebPluginProxy(
PluginChannel* channel,
int route_id,
- WebPluginDelegate* delegate,
const GURL& page_url)
: channel_(channel),
route_id_(route_id),
cp_browsing_context_(0),
window_npobject_(NULL),
plugin_element_(NULL),
- delegate_(delegate),
+ delegate_(NULL),
waiting_for_paint_(false),
page_url_(page_url),
ALLOW_THIS_IN_INITIALIZER_LIST(runnable_method_factory_(this))
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 8e13638..6297f24 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -22,25 +22,29 @@
#include "ipc/ipc_message.h"
#include "webkit/glue/webplugin.h"
+class PluginChannel;
+
namespace base {
class WaitableEvent;
}
-class PluginChannel;
+namespace webkit_glue {
class WebPluginDelegate;
+}
// This is an implementation of WebPlugin that proxies all calls to the
// renderer.
-class WebPluginProxy : public WebPlugin {
+class WebPluginProxy : public webkit_glue::WebPlugin {
public:
// Creates a new proxy for WebPlugin, using the given sender to send the
// marshalled WebPlugin calls.
WebPluginProxy(PluginChannel* channel,
int route_id,
- WebPluginDelegate* delegate,
const GURL& page_url);
~WebPluginProxy();
+ void set_delegate(webkit_glue::WebPluginDelegate* d) { delegate_ = d; }
+
// WebPlugin overrides
void SetWindow(gfx::PluginWindowHandle window);
void WillDestroyWindow(gfx::PluginWindowHandle window);
@@ -83,7 +87,7 @@ class WebPluginProxy : public WebPlugin {
// Returns a WebPluginResourceClient object given its id, or NULL if no
// object with that id exists.
- WebPluginResourceClient* GetResourceClient(int id);
+ webkit_glue::WebPluginResourceClient* GetResourceClient(int id);
// Returns the process id of the renderer that contains this plugin.
int GetRendererProcessId();
@@ -122,7 +126,8 @@ class WebPluginProxy : public WebPlugin {
bool IsOffTheRecord();
- void ResourceClientDeleted(WebPluginResourceClient* resource_client);
+ void ResourceClientDeleted(
+ webkit_glue::WebPluginResourceClient* resource_client);
base::WaitableEvent* modal_dialog_event() {
return modal_dialog_event_.get();
@@ -151,7 +156,8 @@ class WebPluginProxy : public WebPlugin {
// transform of the local HDC.
void UpdateTransform();
- typedef base::hash_map<int, WebPluginResourceClient*> ResourceClientMap;
+ typedef base::hash_map<int, webkit_glue::WebPluginResourceClient*>
+ ResourceClientMap;
ResourceClientMap resource_clients_;
scoped_refptr<PluginChannel> channel_;
@@ -159,7 +165,7 @@ class WebPluginProxy : public WebPlugin {
uint32 cp_browsing_context_;
NPObject* window_npobject_;
NPObject* plugin_element_;
- WebPluginDelegate* delegate_;
+ webkit_glue::WebPluginDelegate* delegate_;
gfx::Rect damaged_rect_;
bool waiting_for_paint_;
scoped_ptr<base::WaitableEvent> modal_dialog_event_;