diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chrome_plugin_host.cc | 2 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.cc | 47 | ||||
-rw-r--r-- | chrome/browser/plugin_process_host.h | 4 | ||||
-rw-r--r-- | chrome/common/child_process_host.cc | 10 | ||||
-rw-r--r-- | chrome/common/child_thread.cc | 8 | ||||
-rw-r--r-- | chrome/common/ipc_logging.cc | 5 | ||||
-rw-r--r-- | chrome/common/plugin_messages.h | 56 | ||||
-rw-r--r-- | chrome/common/plugin_messages_internal.h | 39 | ||||
-rw-r--r-- | chrome/plugin/npobject_proxy.cc | 4 | ||||
-rw-r--r-- | chrome/plugin/npobject_proxy.h | 8 | ||||
-rw-r--r-- | chrome/plugin/npobject_util.cc | 5 | ||||
-rw-r--r-- | chrome/plugin/plugin_thread.cc | 2 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 28 | ||||
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.h | 9 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 74 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.h | 15 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 59 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.h | 23 |
18 files changed, 196 insertions, 202 deletions
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 7372796..62b9411 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -33,6 +33,7 @@ #include "chrome/common/gears_api.h" #include "chrome/common/notification_service.h" #include "chrome/common/net/url_request_intercept_job.h" +#include "chrome/common/plugin_messages.h" #include "chrome/common/render_messages.h" #include "net/base/base64.h" #include "net/base/cookie_monster.h" @@ -43,7 +44,6 @@ // TODO(port): Port these files. #if defined(OS_WIN) #include "chrome/browser/dom_ui/html_dialog_contents.h" -#include "chrome/common/plugin_messages.h" #else #include "chrome/common/temp_scaffolding_stubs.h" #endif diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 5031a35..2b62f6c 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -33,26 +33,27 @@ #include "chrome/common/chrome_plugin_lib.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" +#include "chrome/common/plugin_messages.h" #include "chrome/common/render_messages.h" #include "net/base/cookie_monster.h" #include "net/base/file_stream.h" #include "net/base/io_buffer.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" +#include "webkit/glue/plugins/plugin_constants_win.h" // TODO(port): Port these files. #if defined(OS_WIN) #include "base/win_util.h" #include "chrome/browser/sandbox_policy.h" -#include "chrome/common/plugin_messages.h" #include "chrome/common/win_util.h" #include "sandbox/src/sandbox.h" -#include "webkit/glue/plugins/plugin_constants_win.h" #endif static const char kDefaultPluginFinderURL[] = "http://dl.google.com/chrome/plugins/plugins2.xml"; +#if defined(OS_WIN) // The PluginDownloadUrlHelper is used to handle one download URL request // from the plugin. Each download request is handled by a new instance @@ -109,11 +110,7 @@ PluginDownloadUrlHelper::PluginDownloadUrlHelper( download_file_caller_window_(caller_window), download_url_(download_url), download_source_pid_(source_pid) { -#if defined(OS_WIN) DCHECK(::IsWindow(caller_window)); -#else - // TODO(port): Some window verification for mac and linux. -#endif memset(download_file_buffer_->data(), 0, kDownloadFileBufferSize); download_file_.reset(new net::FileStream()); } @@ -156,14 +153,8 @@ void PluginDownloadUrlHelper::OnResponseStarted(URLRequest* request) { file_util::GetTempDir(&download_file_path_); GURL request_url = request->url(); -#if defined(OS_WIN) download_file_path_ = download_file_path_.Append( UTF8ToWide(request_url.ExtractFileName())); -#else - download_file_path_ = download_file_path_.Append( - request_url.ExtractFileName()); -#endif - download_file_->Open(download_file_path_, base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE); @@ -247,7 +238,6 @@ void PluginDownloadUrlHelper::DownloadCompletedHelper(bool success) { download_file_.reset(); } -#if defined(OS_WIN) std::wstring path = download_file_path_.value(); COPYDATASTRUCT download_file_data = {0}; download_file_data.cbData = @@ -259,16 +249,12 @@ void PluginDownloadUrlHelper::DownloadCompletedHelper(bool success) { ::SendMessage(download_file_caller_window_, WM_COPYDATA, NULL, reinterpret_cast<LPARAM>(&download_file_data)); } -#else - // TODO(port): Send the file data to the caller. - NOTIMPLEMENTED(); -#endif // Don't access any members after this. delete this; } -#if defined(OS_WIN) + // Sends the reply to the create window message on the IO thread. class SendReplyTask : public Task { public: @@ -356,6 +342,14 @@ void PluginProcessHost::OnDestroyWindow(HWND window) { PostMessage(window, WM_CLOSE, 0, 0); } +void PluginProcessHost::OnDownloadUrl(const std::string& url, + int source_pid, + gfx::NativeWindow caller_window) { + PluginDownloadUrlHelper* download_url_helper = + new PluginDownloadUrlHelper(url, source_pid, caller_window); + download_url_helper->InitiateDownload(); +} + void PluginProcessHost::AddWindow(HWND window) { plugin_parent_windows_set_.insert(window); } @@ -499,25 +493,22 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, } void PluginProcessHost::OnMessageReceived(const IPC::Message& msg) { -#if defined(OS_WIN) IPC_BEGIN_MESSAGE_MAP(PluginProcessHost, msg) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ChannelCreated, OnChannelCreated) - IPC_MESSAGE_HANDLER(PluginProcessHostMsg_DownloadUrl, OnDownloadUrl) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetPluginFinderUrl, OnGetPluginFinderUrl) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginMessage, OnPluginMessage) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetCookies, OnGetCookies) IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginProcessHostMsg_ResolveProxy, OnResolveProxy) +#if defined(OS_WIN) IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginProcessHostMsg_CreateWindow, OnCreateWindow) IPC_MESSAGE_HANDLER(PluginProcessHostMsg_DestroyWindow, OnDestroyWindow) + IPC_MESSAGE_HANDLER(PluginProcessHostMsg_DownloadUrl, OnDownloadUrl) +#endif IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP() -#else - // TODO(port): Port plugin_messages_internal.h. - NOTIMPLEMENTED(); -#endif } void PluginProcessHost::OnChannelConnected(int32 peer_pid) { @@ -636,14 +627,6 @@ void PluginProcessHost::OnChannelCreated(const std::wstring& channel_name) { sent_requests_.pop(); } -void PluginProcessHost::OnDownloadUrl(const std::string& url, - int source_pid, - gfx::NativeWindow caller_window) { - PluginDownloadUrlHelper* download_url_helper = - new PluginDownloadUrlHelper(url, source_pid, caller_window); - download_url_helper->InitiateDownload(); -} - void PluginProcessHost::OnGetPluginFinderUrl(std::string* plugin_finder_url) { if (!plugin_finder_url) { NOTREACHED(); diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index 71b7c77..c43fef2 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -97,8 +97,6 @@ class PluginProcessHost : public ChildProcessHost, IPC::Message* reply_msg); // Message handlers. void OnChannelCreated(const std::wstring& channel_name); - void OnDownloadUrl(const std::string& url, int source_pid, - gfx::NativeWindow caller_window); void OnGetPluginFinderUrl(std::string* plugin_finder_url); void OnGetCookies(uint32 request_context, const GURL& url, std::string* cookies); @@ -108,6 +106,8 @@ class PluginProcessHost : public ChildProcessHost, #if defined(OS_WIN) void OnCreateWindow(HWND parent, IPC::Message* reply_msg); void OnDestroyWindow(HWND window); + void OnDownloadUrl(const std::string& url, int source_pid, + gfx::NativeWindow caller_window); #endif virtual bool CanShutdown() { return sent_requests_.empty(); } diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index b22d751..7f934b0 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -14,12 +14,10 @@ #include "chrome/common/ipc_logging.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" +#include "chrome/common/plugin_messages.h" #include "chrome/common/process_watcher.h" #include "chrome/common/result_codes.h" -#if defined(OS_WIN) -#include "chrome/common/plugin_messages.h" -#endif namespace { typedef std::list<ChildProcessHost*> ChildProcessList; @@ -153,7 +151,6 @@ void ChildProcessHost::ListenerHook::OnMessageReceived( msg, host_, &msg_is_ok); if (!handled) { -#if defined(OS_WIN) if (msg.type() == PluginProcessHostMsg_ShutdownRequest::ID) { // Must remove the process from the list now, in case it gets used for a // new instance before our watcher tells us that the process terminated. @@ -161,9 +158,6 @@ void ChildProcessHost::ListenerHook::OnMessageReceived( if (host_->CanShutdown()) host_->Send(new PluginProcessMsg_Shutdown()); } else { -#else - { -#endif host_->OnMessageReceived(msg); } } @@ -180,9 +174,7 @@ void ChildProcessHost::ListenerHook::OnMessageReceived( void ChildProcessHost::ListenerHook::OnChannelConnected(int32 peer_pid) { host_->opening_channel_ = false; host_->OnChannelConnected(peer_pid); -#if defined(OS_WIN) host_->Send(new PluginProcessMsg_AskBeforeShutdown()); -#endif // Notify in the main loop of the connection. host_->Notify(NotificationType::CHILD_PROCESS_HOST_CONNECTED); diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index c1ad034..94b3186 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -9,11 +9,9 @@ #include "chrome/common/child_process.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/ipc_logging.h" +#include "chrome/common/plugin_messages.h" #include "webkit/glue/webkit_glue.h" -#if defined(OS_WIN) -#include "chrome/common/plugin_messages.h" -#endif // V8 needs a 1MB stack size. const size_t ChildThread::kV8StackSize = 1024 * 1024; @@ -71,7 +69,6 @@ void ChildThread::OnMessageReceived(const IPC::Message& msg) { if (resource_dispatcher_->OnMessageReceived(msg)) return; -#if defined(OS_WIN) if (msg.type() == PluginProcessMsg_AskBeforeShutdown::ID) { check_with_browser_before_shutdown_ = true; return; @@ -81,7 +78,6 @@ void ChildThread::OnMessageReceived(const IPC::Message& msg) { owner_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask()); return; } -#endif if (msg.routing_id() == MSG_ROUTING_CONTROL) { OnControlMessageReceived(msg); @@ -121,11 +117,9 @@ void ChildThread::OnProcessFinalRelease() { return; } -#if defined(OS_WIN) // The child process shutdown sequence is a request response based mechanism, // where we send out an initial feeler request to the child process host // instance in the browser to verify if it's ok to shutdown the child process. // The browser then sends back a response if it's ok to shutdown. Send(new PluginProcessHostMsg_ShutdownRequest); -#endif } diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc index d02b3b2..cb63533 100644 --- a/chrome/common/ipc_logging.cc +++ b/chrome/common/ipc_logging.cc @@ -27,8 +27,11 @@ // can get *MsgLog function etc. This makes ipc logs much more informative. #include "chrome/common/render_messages.h" #include "chrome/test/automation/automation_messages.h" + #if defined(OS_WIN) -// TODO(port): These messages will need to be ported at some point +// Pulling this file in Mac/Linux causes a lot of binaries to need to bring in +// WebKit and all the dependencies, which results in a very large number of +// linker errors. #include "chrome/common/plugin_messages.h" #endif diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 4cc8048..7b5ce73 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -13,6 +13,7 @@ #include <string> #include <vector> +#include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" #include "base/basictypes.h" #include "chrome/common/ipc_message_utils.h" @@ -27,12 +28,14 @@ // predefined IPC message. struct PluginMsg_Init_Params { - HWND containing_window; + gfx::NativeViewId containing_window; GURL url; std::vector<std::string> arg_names; std::vector<std::string> arg_values; - bool load_manually; +#if defined(OS_WIN) HANDLE modal_dialog_event; +#endif + bool load_manually; }; struct PluginHostMsg_URLRequest_Params { @@ -43,7 +46,7 @@ struct PluginHostMsg_URLRequest_Params { bool is_file_data; bool notify; std::string url; - HANDLE notify_data; + intptr_t notify_data; bool popups_allowed; }; @@ -51,13 +54,8 @@ struct PluginMsg_URLRequestReply_Params { int resource_id; std::string url; bool notify_needed; - HANDLE notify_data; - HANDLE stream; -}; - -struct PluginMsg_PrintResponse_Params { - HANDLE shared_memory; - size_t size; + intptr_t notify_data; + intptr_t stream; }; struct PluginMsg_DidReceiveResponseParams { @@ -96,7 +94,7 @@ struct NPVariant_Param { double double_value; std::string string_value; int npobject_routing_id; - void* npobject_pointer; + intptr_t npobject_pointer; }; @@ -112,16 +110,20 @@ struct ParamTraits<PluginMsg_Init_Params> { DCHECK(p.arg_names.size() == p.arg_values.size()); WriteParam(m, p.arg_names); WriteParam(m, p.arg_values); - WriteParam(m, p.load_manually); +#if defined(OS_WIN) WriteParam(m, p.modal_dialog_event); +#endif + WriteParam(m, p.load_manually); } static bool Read(const Message* m, void** iter, param_type* p) { return ReadParam(m, iter, &p->containing_window) && ReadParam(m, iter, &p->url) && ReadParam(m, iter, &p->arg_names) && ReadParam(m, iter, &p->arg_values) && - ReadParam(m, iter, &p->load_manually) && - ReadParam(m, iter, &p->modal_dialog_event); +#if defined(OS_WIN) + ReadParam(m, iter, &p->modal_dialog_event) && +#endif + ReadParam(m, iter, &p->load_manually); } static void Log(const param_type& p, std::wstring* l) { l->append(L"("); @@ -133,9 +135,11 @@ struct ParamTraits<PluginMsg_Init_Params> { l->append(L", "); LogParam(p.arg_values, l); l->append(L", "); - LogParam(p.load_manually, l); - l->append(L", "); +#if defined(OS_WIN) LogParam(p.modal_dialog_event, l); + l->append(L", "); +#endif + LogParam(p.load_manually, l); l->append(L")"); } }; @@ -223,22 +227,6 @@ struct ParamTraits<PluginMsg_URLRequestReply_Params> { }; template <> -struct ParamTraits<PluginMsg_PrintResponse_Params> { - typedef PluginMsg_PrintResponse_Params param_type; - static void Write(Message* m, const param_type& p) { - WriteParam(m, p.shared_memory); - WriteParam(m, p.size); - } - static bool Read(const Message* m, void** iter, param_type* r) { - return - ReadParam(m, iter, &r->shared_memory) && - ReadParam(m, iter, &r->size); - } - static void Log(const param_type& p, std::wstring* l) { - } -}; - -template <> struct ParamTraits<PluginMsg_DidReceiveResponseParams> { typedef PluginMsg_DidReceiveResponseParams param_type; static void Write(Message* m, const param_type& p) { @@ -294,6 +282,7 @@ struct ParamTraits<NPEvent> { return true; } static void Log(const param_type& p, std::wstring* l) { +#if defined(OS_WIN) std::wstring event, wparam, lparam; lparam = StringPrintf(L"(%d, %d)", LOWORD(p.lParam), HIWORD(p.lParam)); switch(p.event) { @@ -356,6 +345,9 @@ struct ParamTraits<NPEvent> { l->append(L", "); LogParam(lparam, l); l->append(L")"); +#else + l->append(L"<NPEvent>"); +#endif } }; diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index 61c53f0..11a0365 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -41,11 +41,6 @@ IPC_BEGIN_MESSAGES(PluginProcessHost) IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, std::wstring /* channel_name */) - IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, - std::string /* URL */, - int /* process id */, - HWND /* caller window */) - IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, std::string /* plugin finder URL */) @@ -77,6 +72,7 @@ IPC_BEGIN_MESSAGES(PluginProcessHost) int /* network error */, std::string /* proxy list */) +#if defined(OS_WIN) // Creates a child window of the given parent window on the UI thread. IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, HWND /* parent */, @@ -86,6 +82,12 @@ IPC_BEGIN_MESSAGES(PluginProcessHost) IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_DestroyWindow, HWND /* window */) + IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, + std::string /* URL */, + int /* process id */, + HWND /* caller window */) +#endif + IPC_END_MESSAGES(PluginProcessHost) @@ -122,12 +124,13 @@ IPC_BEGIN_MESSAGES(Plugin) // plugin knows it can send more invalidates. IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) - IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_Print, - PluginMsg_PrintResponse_Params /* params */) + IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, + base::SharedMemoryHandle /* shared_memory*/, + size_t /* size */) IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_GetPluginScriptableObject, int /* route_id */, - void* /* npobject_ptr */) + intptr_t /* npobject_ptr */) IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_DidFinishLoadWithReason, int /* reason */) @@ -173,7 +176,7 @@ IPC_BEGIN_MESSAGES(Plugin) std::wstring /* result */, bool /* success */, bool /* notify required */, - int /* notify data */) + intptr_t /* notify data */) IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse, std::string /* url */, @@ -194,7 +197,7 @@ IPC_BEGIN_MESSAGES(Plugin) IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_URLRequestRouted, std::string /* url */, bool /* notify_needed */, - HANDLE /* notify data */) + intptr_t /* notify data */) IPC_END_MESSAGES(Plugin) @@ -206,13 +209,17 @@ IPC_BEGIN_MESSAGES(PluginHost) // Sends the plugin window information to the renderer. // The window parameter is a handle to the window if the plugin is a windowed // plugin. It is NULL for windowless plugins. + IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow, + gfx::NativeViewId /* window */) + +#if defined(OS_WIN) // The modal_loop_pump_messages_event parameter is an event handle which is // passed in for windowless plugins and is used to indicate if messages // are to be pumped in sync calls to the plugin process. Currently used // in HandleEvent calls. - IPC_SYNC_MESSAGE_ROUTED2_0(PluginHostMsg_SetWindow, - HWND /* window */, + IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent, HANDLE /* modal_loop_pump_messages_event */) +#endif IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest, PluginHostMsg_URLRequest_Params) @@ -226,12 +233,12 @@ IPC_BEGIN_MESSAGES(PluginHost) IPC_SYNC_MESSAGE_ROUTED1_2(PluginHostMsg_GetWindowScriptNPObject, int /* route id */, bool /* success */, - void* /* npobject_ptr */) + intptr_t /* npobject_ptr */) IPC_SYNC_MESSAGE_ROUTED1_2(PluginHostMsg_GetPluginElement, int /* route id */, bool /* success */, - void* /* npobject_ptr */) + intptr_t /* npobject_ptr */) IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, GURL /* url */, @@ -264,9 +271,9 @@ IPC_BEGIN_MESSAGES(PluginHost) IPC_MESSAGE_ROUTED5(PluginHostMsg_InitiateHTTPRangeRequest, std::string /* url */, std::string /* range_info */, - HANDLE /* existing_stream */, + intptr_t /* existing_stream */, bool /* notify_needed */, - HANDLE /* notify_data */) + intptr_t /* notify_data */) IPC_END_MESSAGES(PluginHost) diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc index 019b1b2..0264321 100644 --- a/chrome/plugin/npobject_proxy.cc +++ b/chrome/plugin/npobject_proxy.cc @@ -48,7 +48,7 @@ NPObjectProxy* NPObjectProxy::GetProxy(NPObject* object) { NPObjectProxy::NPObjectProxy( PluginChannelBase* channel, int route_id, - void* npobject_ptr, + intptr_t npobject_ptr, base::WaitableEvent* modal_dialog_event) : channel_(channel), route_id_(route_id), @@ -67,7 +67,7 @@ NPObjectProxy::~NPObjectProxy() { NPObject* NPObjectProxy::Create(PluginChannelBase* channel, int route_id, - void* npobject_ptr, + intptr_t npobject_ptr, base::WaitableEvent* modal_dialog_event) { NPObjectWrapper* obj = reinterpret_cast<NPObjectWrapper*>( NPN_CreateObject(0, &npclass_proxy_)); diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h index f0e1085..bb0ec2c 100644 --- a/chrome/plugin/npobject_proxy.h +++ b/chrome/plugin/npobject_proxy.h @@ -35,7 +35,7 @@ class NPObjectProxy : public IPC::Channel::Listener, // modal_dialog_event_ is must be valid for the lifetime of the NPObjectProxy. static NPObject* Create(PluginChannelBase* channel, int route_id, - void* npobject_ptr, + intptr_t npobject_ptr, base::WaitableEvent* modal_dialog_event); // IPC::Message::Sender implementation: @@ -45,7 +45,7 @@ class NPObjectProxy : public IPC::Channel::Listener, // Returns the real NPObject's pointer (obviously only valid in the other // process). - void* npobject_ptr() { return npobject_ptr_; } + intptr_t npobject_ptr() { return npobject_ptr_; } // The next 8 functions are called on NPObjects from the plugin and browser. static bool NPHasMethod(NPObject *obj, @@ -96,7 +96,7 @@ class NPObjectProxy : public IPC::Channel::Listener, private: NPObjectProxy(PluginChannelBase* channel, int route_id, - void* npobject_ptr, + intptr_t npobject_ptr, base::WaitableEvent* modal_dialog_event); // IPC::Channel::Listener implementation: @@ -111,7 +111,7 @@ class NPObjectProxy : public IPC::Channel::Listener, static NPClass npclass_proxy_; int route_id_; - void* npobject_ptr_; + intptr_t npobject_ptr_; scoped_refptr<PluginChannelBase> channel_; base::WaitableEvent* modal_dialog_event_; }; diff --git a/chrome/plugin/npobject_util.cc b/chrome/plugin/npobject_util.cc index 8e30495..d7bad8f 100644 --- a/chrome/plugin/npobject_util.cc +++ b/chrome/plugin/npobject_util.cc @@ -193,7 +193,8 @@ void CreateNPVariantParam(const NPVariant& variant, NPObjectStub* object_stub = new NPObjectStub( variant.value.objectValue, channel, route_id, modal_dialog_event); param->npobject_routing_id = route_id; - param->npobject_pointer = variant.value.objectValue; + param->npobject_pointer = + reinterpret_cast<intptr_t>(variant.value.objectValue); } else { param->type = NPVARIANT_PARAM_VOID; } @@ -249,7 +250,7 @@ void CreateNPVariant(const NPVariant_Param& param, case NPVARIANT_PARAM_OBJECT_POINTER: result->type = NPVariantType_Object; result->value.objectValue = - static_cast<NPObject*>(param.npobject_pointer); + reinterpret_cast<NPObject*>(param.npobject_pointer); NPN_RetainObject(result->value.objectValue); break; default: diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 9993c37..fe9aa02 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -114,6 +114,7 @@ void PluginThread::OnPluginMessage(const std::vector<unsigned char> &data) { namespace webkit_glue { +#if defined(OS_WIN) bool DownloadUrl(const std::string& url, HWND caller_window) { PluginThread* plugin_thread = PluginThread::current(); if (!plugin_thread) { @@ -126,6 +127,7 @@ bool DownloadUrl(const std::string& url, HWND caller_window) { caller_window); return plugin_thread->Send(message); } +#endif bool GetPluginFinderURL(std::string* plugin_finder_url) { if (!plugin_finder_url) { diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 93d9fa3..9d83b49 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -127,10 +127,12 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params, FilePath path = FilePath(command_line.GetSwitchValue(switches::kPluginPath)); delegate_ = WebPluginDelegate::Create( - path, mime_type_, params.containing_window); + path, mime_type_, gfx::NativeViewFromId(params.containing_window)); if (delegate_) { - webplugin_ = new WebPluginProxy( - channel_, instance_id_, delegate_, params.modal_dialog_event); + webplugin_ = new WebPluginProxy(channel_, instance_id_, delegate_); +#if defined(OS_WIN) + webplugin_->SetModalDialogEvent(params.modal_dialog_event); +#endif *result = delegate_->Initialize( params.url, argn, argv, argc, webplugin_, params.load_manually); } @@ -211,7 +213,8 @@ void WebPluginDelegateStub::OnDidPaint() { webplugin_->DidPaint(); } -void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) { +void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, + size_t* size) { gfx::Emf emf; if (!emf.CreateDc(NULL, NULL)) { NOTREACHED(); @@ -225,14 +228,13 @@ void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) { return; } - size_t size = emf.GetDataSize(); - DCHECK(size); - params->size = size; + *size = emf.GetDataSize(); + DCHECK(*size); base::SharedMemory shared_buf; - CreateSharedBuffer(size, &shared_buf, ¶ms->shared_memory); + CreateSharedBuffer(*size, &shared_buf, shared_memory); // Retrieve a copy of the data. - bool success = emf.GetData(shared_buf.memory(), size); + bool success = emf.GetData(shared_buf.memory(), *size); DCHECK(success); } @@ -246,7 +248,7 @@ void WebPluginDelegateStub::OnUpdateGeometry( } void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id, - void** npobject_ptr) { + intptr_t* npobject_ptr) { NPObject* object = delegate_->GetPluginScriptableObject(); if (!object) { *route_id = MSG_ROUTING_NONE; @@ -254,7 +256,7 @@ void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id, } *route_id = channel_->GenerateRouteID(); - *npobject_ptr = object; + *npobject_ptr = reinterpret_cast<intptr_t>(object); // The stub will delete itself when the proxy tells it that it's released, or // otherwise when the channel is closed. NPObjectStub* stub = new NPObjectStub( @@ -268,7 +270,7 @@ void WebPluginDelegateStub::OnSendJavaScriptStream(const std::string& url, const std::wstring& result, bool success, bool notify_needed, - int notify_data) { + intptr_t notify_data) { delegate_->SendJavaScriptStream(url, result, success, notify_needed, notify_data); } @@ -337,6 +339,6 @@ void WebPluginDelegateStub::OnHandleURLRequestReply( void WebPluginDelegateStub::OnURLRequestRouted(const std::string& url, bool notify_needed, - HANDLE notify_data) { + intptr_t notify_data) { delegate_->URLRequestRouted(url, notify_needed, notify_data); } diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h index 9599945..995d318 100644 --- a/chrome/plugin/webplugin_delegate_stub.h +++ b/chrome/plugin/webplugin_delegate_stub.h @@ -20,7 +20,6 @@ class WebPluginProxy; class WebPluginDelegate; struct PluginMsg_Init_Params; struct PluginMsg_DidReceiveResponseParams; -struct PluginMsg_PrintResponse_Params; struct PluginMsg_URLRequestReply_Params; class WebCursor; @@ -63,17 +62,17 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, void OnPaint(const gfx::Rect& damaged_rect); void OnDidPaint(); - void OnPrint(PluginMsg_PrintResponse_Params* params); + void OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size); void OnUpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect, const base::SharedMemoryHandle& windowless_buffer, const base::SharedMemoryHandle& background_buffer); - void OnGetPluginScriptableObject(int* route_id, void** npobject_ptr); + void OnGetPluginScriptableObject(int* route_id, intptr_t* npobject_ptr); void OnSendJavaScriptStream(const std::string& url, const std::wstring& result, bool success, bool notify_needed, - int notify_data); + intptr_t notify_data); void OnDidReceiveManualResponse( const std::string& url, @@ -87,7 +86,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, const PluginMsg_URLRequestReply_Params& params); void OnURLRequestRouted(const std::string& url, bool notify_needed, - HANDLE notify_data); + intptr_t notify_data); void CreateSharedBuffer(size_t size, base::SharedMemory* shared_buf, diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 34bdb92..3fb67c7 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -29,8 +29,7 @@ static ContextMap& GetContextMap() { WebPluginProxy::WebPluginProxy( PluginChannel* channel, int route_id, - WebPluginDelegate* delegate, - HANDLE modal_dialog_event) + WebPluginDelegate* delegate) : channel_(channel), route_id_(route_id), cp_browsing_context_(0), @@ -41,19 +40,6 @@ WebPluginProxy::WebPluginProxy( #pragma warning(suppress: 4355) // can use this runnable_method_factory_(this), parent_window_(NULL) { - - HANDLE event; - BOOL result = DuplicateHandle(channel->renderer_handle(), - modal_dialog_event, - GetCurrentProcess(), - &event, - SYNCHRONIZE, - FALSE, - 0); - DCHECK(result) << - "Couldn't duplicate the modal dialog handle for the plugin." \ - "handle: " << channel->renderer_handle() << ". err: " << GetLastError(); - modal_dialog_event_.reset(new base::WaitableEvent(event)); } WebPluginProxy::~WebPluginProxy() { @@ -70,18 +56,8 @@ bool WebPluginProxy::Send(IPC::Message* msg) { return channel_->Send(msg); } -bool WebPluginProxy::SetWindow(HWND window, HANDLE pump_messages_event) { - HANDLE pump_messages_event_for_renderer = NULL; - - if (pump_messages_event) { - DCHECK(window == NULL); - DuplicateHandle(GetCurrentProcess(), pump_messages_event, - channel_->renderer_handle(), - &pump_messages_event_for_renderer, - 0, FALSE, DUPLICATE_SAME_ACCESS); - DCHECK(pump_messages_event_for_renderer != NULL); - } else { - DCHECK (window); +bool WebPluginProxy::SetWindow(gfx::NativeView window) { + if (window) { // To make scrolling windowed plugins fast, we create the page's direct // child windows in the browser process. This way no cross process messages // are sent. @@ -102,12 +78,41 @@ bool WebPluginProxy::SetWindow(HWND window, HANDLE pump_messages_event) { window = parent_window_; } - Send(new PluginHostMsg_SetWindow(route_id_, window, - pump_messages_event_for_renderer)); + Send(new PluginHostMsg_SetWindow(route_id_, gfx::IdFromNativeView(window))); return false; } +#if defined(OS_WIN) +void WebPluginProxy::SetWindowlessPumpEvent(HANDLE pump_messages_event) { + HANDLE pump_messages_event_for_renderer = NULL; + DuplicateHandle(GetCurrentProcess(), pump_messages_event, + channel_->renderer_handle(), + &pump_messages_event_for_renderer, + 0, FALSE, DUPLICATE_SAME_ACCESS); + DCHECK(pump_messages_event_for_renderer != NULL); + Send(new PluginHostMsg_SetWindowlessPumpEvent( + route_id_, pump_messages_event_for_renderer)); +} + +void WebPluginProxy::SetModalDialogEvent(HANDLE modal_dialog_event) { + // TODO(port): figure out how this will be set in the browser process, or + // come up with a different mechanism. + HANDLE event; + BOOL result = DuplicateHandle(channel_->renderer_handle(), + modal_dialog_event, + GetCurrentProcess(), + &event, + SYNCHRONIZE, + FALSE, + 0); + DCHECK(result) << + "Couldn't duplicate the modal dialog handle for the plugin." \ + "handle: " << channel_->renderer_handle() << ". err: " << GetLastError(); + modal_dialog_event_.reset(new base::WaitableEvent(event)); +} +#endif + void WebPluginProxy::CancelResource(int id) { Send(new PluginHostMsg_CancelResource(route_id_, id)); resource_clients_.erase(id); @@ -147,7 +152,7 @@ NPObject* WebPluginProxy::GetWindowScriptNPObject() { int npobject_route_id = channel_->GenerateRouteID(); bool success = false; - void* npobject_ptr; + intptr_t npobject_ptr; Send(new PluginHostMsg_GetWindowScriptNPObject( route_id_, npobject_route_id, &success, &npobject_ptr)); if (!success) @@ -167,7 +172,7 @@ NPObject* WebPluginProxy::GetPluginElement() { int npobject_route_id = channel_->GenerateRouteID(); bool success = false; - void* npobject_ptr; + intptr_t npobject_ptr; Send(new PluginHostMsg_GetPluginElement( route_id_, npobject_route_id, &success, &npobject_ptr)); if (!success) @@ -265,7 +270,8 @@ void WebPluginProxy::HandleURLRequest(const char *method, const char* target, unsigned int len, const char* buf, bool is_file_data, bool notify, const char* url, - void* notify_data, bool popups_allowed) { + intptr_t notify_data, + bool popups_allowed) { if (!url) { NOTREACHED(); return; @@ -433,9 +439,9 @@ void WebPluginProxy::CancelDocumentLoad() { void WebPluginProxy::InitiateHTTPRangeRequest(const char* url, const char* range_info, - void* existing_stream, + intptr_t existing_stream, bool notify_needed, - HANDLE notify_data) { + int notify_data) { Send(new PluginHostMsg_InitiateHTTPRangeRequest(route_id_, url, range_info, existing_stream, diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index cba1ac5..8c4629d 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -30,12 +30,15 @@ class WebPluginProxy : public WebPlugin { // marshalled WebPlugin calls. WebPluginProxy(PluginChannel* channel, int route_id, - WebPluginDelegate* delegate, - HANDLE modal_dialog_event); + WebPluginDelegate* delegate); ~WebPluginProxy(); // WebPlugin overrides - bool SetWindow(HWND window, HANDLE pump_messages_event); + bool SetWindow(gfx::NativeView window); +#if defined(OS_WIN) + void SetWindowlessPumpEvent(HANDLE pump_messages_event); + void SetModalDialogEvent(HANDLE modal_dialog_event); +#endif void CancelResource(int id); void Invalidate(); void InvalidateRect(const gfx::Rect& rect); @@ -79,7 +82,7 @@ class WebPluginProxy : public WebPlugin { const char* target, unsigned int len, const char* buf, bool is_file_data, bool notify, const char* url, - void* notify_data, bool popups_allowed); + intptr_t notify_data, bool popups_allowed); void UpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect, @@ -90,9 +93,9 @@ class WebPluginProxy : public WebPlugin { void InitiateHTTPRangeRequest(const char* url, const char* range_info, - void* existing_stream, + intptr_t existing_stream, bool notify_needed, - HANDLE notify_data); + intptr_t notify_data); bool IsOffTheRecord(); diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 87185ff..c877fb8 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -45,7 +45,7 @@ class ResourceClientProxy : public WebPluginResourceClient { } void Initialize(int resource_id, const std::string &url, bool notify_needed, - void *notify_data, void* existing_stream) { + intptr_t notify_data, intptr_t existing_stream) { resource_id_ = resource_id; url_ = url; notify_needed_ = notify_needed; @@ -128,7 +128,7 @@ private: scoped_refptr<PluginChannelHost> channel_; std::string url_; bool notify_needed_; - void* notify_data_; + intptr_t notify_data_; // Set to true if the response expected is a multibyte response. // For e.g. response for a HTTP byte range request. bool multibyte_response_expected_; @@ -231,7 +231,7 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, // Now tell the PluginInstance in the plugin process to initialize. PluginMsg_Init_Params params; - params.containing_window = gfx::NativeViewFromId(render_view_->host_window()); + params.containing_window = render_view_->host_window(); params.url = url; for (int i = 0; i < argc; ++i) { params.arg_names.push_back(argn[i]); @@ -243,7 +243,9 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, } } params.load_manually = load_manually; +#if defined(OS_WIN) params.modal_dialog_event = render_view_->modal_dialog_event()->handle(); +#endif plugin_ = plugin; @@ -268,7 +270,7 @@ void WebPluginDelegateProxy::SendJavaScriptStream(const std::string& url, const std::wstring& result, bool success, bool notify_needed, - int notify_data) { + intptr_t notify_data) { PluginMsg_SendJavaScriptStream* msg = new PluginMsg_SendJavaScriptStream(instance_id_, url, result, success, notify_needed, @@ -317,6 +319,8 @@ void WebPluginDelegateProxy::InstallMissingPlugin() { void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) { IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg) IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow) + IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindowlessPumpEvent, + OnSetWindowlessPumpEvent) IPC_MESSAGE_HANDLER(PluginHostMsg_CancelResource, OnCancelResource) IPC_MESSAGE_HANDLER(PluginHostMsg_InvalidateRect, OnInvalidateRect) IPC_MESSAGE_HANDLER(PluginHostMsg_GetWindowScriptNPObject, @@ -517,17 +521,19 @@ bool WebPluginDelegateProxy::BackgroundChanged( } void WebPluginDelegateProxy::Print(HDC hdc) { - PluginMsg_PrintResponse_Params params = { 0 }; - Send(new PluginMsg_Print(instance_id_, ¶ms)); + base::SharedMemoryHandle shared_memory; + size_t size; + if (!Send(new PluginMsg_Print(instance_id_, &shared_memory, &size))) + return; - base::SharedMemory memory(params.shared_memory, true); - if (!memory.Map(params.size)) { + base::SharedMemory memory(shared_memory, true); + if (!memory.Map(size)) { NOTREACHED(); return; } gfx::Emf emf; - if (!emf.CreateFromData(memory.memory(), params.size)) { + if (!emf.CreateFromData(memory.memory(), size)) { NOTREACHED(); return; } @@ -540,7 +546,7 @@ NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() { return NPN_RetainObject(npobject_); int route_id = MSG_ROUTING_NONE; - void* npobject_ptr; + intptr_t npobject_ptr; Send(new PluginMsg_GetPluginScriptableObject( instance_id_, &route_id, &npobject_ptr)); if (route_id == MSG_ROUTING_NONE) @@ -579,21 +585,22 @@ int WebPluginDelegateProxy::GetProcessId() { return channel_host_->peer_pid(); } -void WebPluginDelegateProxy::OnSetWindow( - HWND window, HANDLE modal_loop_pump_messages_event) { +void WebPluginDelegateProxy::OnSetWindow(gfx::NativeViewId window_id) { + gfx::NativeView window = gfx::NativeViewFromId(window_id); windowless_ = window == NULL; if (plugin_) - plugin_->SetWindow(window, modal_loop_pump_messages_event); + plugin_->SetWindow(window); +} +#if defined(OS_WIN) + void WebPluginDelegateProxy::OnSetWindowlessPumpEvent( + HANDLE modal_loop_pump_messages_event) { DCHECK(modal_loop_pump_messages_event_ == NULL); - if (modal_loop_pump_messages_event) { - modal_loop_pump_messages_event_.reset( - new base::WaitableEvent(modal_loop_pump_messages_event)); - } else { - modal_loop_pump_messages_event_.reset(); - } + modal_loop_pump_messages_event_.reset( + new base::WaitableEvent(modal_loop_pump_messages_event)); } +#endif void WebPluginDelegateProxy::OnCancelResource(int id) { if (plugin_) @@ -610,7 +617,7 @@ void WebPluginDelegateProxy::OnInvalidateRect(const gfx::Rect& rect) { } void WebPluginDelegateProxy::OnGetWindowScriptNPObject( - int route_id, bool* success, void** npobject_ptr) { + int route_id, bool* success, intptr_t* npobject_ptr) { *success = false; NPObject* npobject = NULL; if (plugin_) @@ -627,11 +634,11 @@ void WebPluginDelegateProxy::OnGetWindowScriptNPObject( window_script_object_ = stub; window_script_object_->set_proxy(this); *success = true; - *npobject_ptr = npobject; + *npobject_ptr = reinterpret_cast<intptr_t>(npobject); } void WebPluginDelegateProxy::OnGetPluginElement( - int route_id, bool* success, void** npobject_ptr) { + int route_id, bool* success, intptr_t* npobject_ptr) { *success = false; NPObject* npobject = NULL; if (plugin_) @@ -645,7 +652,7 @@ void WebPluginDelegateProxy::OnGetPluginElement( npobject, channel_host_.get(), route_id, render_view_->modal_dialog_event()); *success = true; - *npobject_ptr = npobject; + *npobject_ptr = reinterpret_cast<intptr_t>(npobject); } void WebPluginDelegateProxy::OnSetCookie(const GURL& url, @@ -741,7 +748,7 @@ void WebPluginDelegateProxy::OnHandleURLRequest( WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( int resource_id, const std::string &url, bool notify_needed, - void* notify_data, void* npstream) { + intptr_t notify_data, intptr_t npstream) { ResourceClientProxy* proxy = new ResourceClientProxy(channel_host_, instance_id_); proxy->Initialize(resource_id, url, notify_needed, notify_data, npstream); @@ -750,7 +757,7 @@ WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( void WebPluginDelegateProxy::URLRequestRouted(const std::string& url, bool notify_needed, - void* notify_data) { + intptr_t notify_data) { Send(new PluginMsg_URLRequestRouted(instance_id_, url, notify_needed, notify_data)); } @@ -761,7 +768,7 @@ void WebPluginDelegateProxy::OnCancelDocumentLoad() { void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( const std::string& url, const std::string& range_info, - HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { + intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), existing_stream, notify_needed, notify_data); diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index d7864e2..8af9733 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -75,7 +75,7 @@ class WebPluginDelegateProxy : public WebPluginDelegate, virtual void SendJavaScriptStream(const std::string& url, const std::wstring& result, bool success, bool notify_needed, - int notify_data); + intptr_t notify_data); virtual void DidReceiveManualResponse(const std::string& url, const std::string& mime_type, @@ -90,12 +90,12 @@ class WebPluginDelegateProxy : public WebPluginDelegate, virtual WebPluginResourceClient* CreateResourceClient(int resource_id, const std::string &url, bool notify_needed, - void* notify_data, - void* existing_stream); + intptr_t notify_data, + intptr_t existing_stream); // Notifies the delegate about a Get/Post URL request getting routed virtual void URLRequestRouted(const std::string&url, bool notify_needed, - void* notify_data); + intptr_t notify_data); protected: template<class WebPluginDelegateProxy> friend class DeleteTask; @@ -108,16 +108,18 @@ class WebPluginDelegateProxy : public WebPluginDelegate, // Message handlers for messages that proxy WebPlugin methods, which // we translate into calls to the real WebPlugin. - void OnSetWindow(gfx::NativeView window, - HANDLE modal_loop_pump_messages_event); + void OnSetWindow(gfx::NativeViewId window); +#if defined(OS_WIN) + void OnSetWindowlessPumpEvent(HANDLE modal_loop_pump_messages_event); +#endif void OnCompleteURL(const std::string& url_in, std::string* url_out, bool* result); void OnHandleURLRequest(const PluginHostMsg_URLRequest_Params& params); void OnCancelResource(int id); void OnInvalidateRect(const gfx::Rect& rect); void OnGetWindowScriptNPObject(int route_id, bool* success, - void** npobject_ptr); - void OnGetPluginElement(int route_id, bool* success, void** npobject_ptr); + intptr_t* npobject_ptr); + void OnGetPluginElement(int route_id, bool* success, intptr_t* npobject_ptr); void OnSetCookie(const GURL& url, const GURL& policy_url, const std::string& cookie); @@ -131,8 +133,9 @@ class WebPluginDelegateProxy : public WebPluginDelegate, void OnCancelDocumentLoad(); void OnInitiateHTTPRangeRequest(const std::string& url, const std::string& range_info, - HANDLE existing_stream, bool notify_needed, - HANDLE notify_data); + intptr_t existing_stream, + bool notify_needed, + intptr_t notify_data); // Draw a graphic indicating a crashed plugin. void PaintSadPlugin(HDC hdc, const gfx::Rect& rect); |