| Index: chrome/plugin/webplugin_proxy.h
|
| ===================================================================
|
| --- chrome/plugin/webplugin_proxy.h (revision 2353)
|
| +++ chrome/plugin/webplugin_proxy.h (working copy)
|
| @@ -8,12 +8,14 @@
|
| #include "base/hash_tables.h"
|
| #include "base/ref_counted.h"
|
| #include "base/scoped_handle.h"
|
| +#include "base/shared_memory.h"
|
| +#include "base/timer.h"
|
| #include "chrome/common/ipc_message.h"
|
| #include "chrome/common/chrome_plugin_api.h"
|
| #include "webkit/glue/webplugin.h"
|
|
|
| class PluginChannel;
|
| -class WebPluginDelegate;
|
| +class WebPluginDelegateImpl;
|
|
|
| // This is an implementation of WebPlugin that proxies all calls to the
|
| // renderer.
|
| @@ -23,7 +25,7 @@
|
| // marshalled WebPlugin calls.
|
| WebPluginProxy(PluginChannel* channel,
|
| int route_id,
|
| - WebPluginDelegate* delegate,
|
| + WebPluginDelegateImpl* delegate,
|
| HANDLE modal_dialog_event);
|
| ~WebPluginProxy();
|
|
|
| @@ -60,8 +62,6 @@
|
| // object with that id exists.
|
| WebPluginResourceClient* GetResourceClient(int id);
|
|
|
| - void WillPaint();
|
| -
|
| // Notification received on a plugin issued resource request
|
| // creation.
|
| void OnResourceCreated(int resource_id, HANDLE cookie);
|
| @@ -73,9 +73,26 @@
|
| bool notify, const char* url,
|
| void* notify_data, bool popups_allowed);
|
|
|
| + void UpdateGeometry(const gfx::Rect& window_rect,
|
| + const gfx::Rect& clip_rect,
|
| + bool visible,
|
| + const SharedMemoryHandle& windowless_buffer,
|
| + const SharedMemoryLock& lock);
|
| +
|
| private:
|
| bool Send(IPC::Message* msg);
|
|
|
| + // Called periodically so that we can paint windowless plugins.
|
| + void OnPaintTimerFired();
|
| +
|
| + // Updates the shared memory section where windowless plugins paint.
|
| + void SetWindowlessBuffer(const SharedMemoryHandle& handle,
|
| + const SharedMemoryLock& lock);
|
| +
|
| + // Called when a plugin's origin moves, so that we can update the world
|
| + // transform of the local HDC.
|
| + void UpdateTransform();
|
| +
|
| typedef base::hash_map<int, WebPluginResourceClient*> ResourceClientMap;
|
| ResourceClientMap resource_clients_;
|
|
|
| @@ -83,11 +100,21 @@
|
| int route_id_;
|
| NPObject* window_npobject_;
|
| NPObject* plugin_element_;
|
| - WebPluginDelegate* delegate_;
|
| - gfx::Rect damaged_rect_;
|
| - bool waiting_for_paint_;
|
| + WebPluginDelegateImpl* delegate_;
|
| uint32 cp_browsing_context_;
|
| ScopedHandle modal_dialog_event_;
|
| +
|
| + // Used to desynchronize windowless painting. We accumulate invalidates and
|
| + // paint into a shared buffer when our repeating timer fires. After painting
|
| + // we tell the renderer asynchronously and it paints from the buffer. This
|
| + // allows the renderer to paint without a blocking call, which improves
|
| + // performance, and lets us control the frame rate at which we paint.
|
| + gfx::Rect damaged_rect_;
|
| + base::RepeatingTimer<WebPluginProxy> paint_timer_;
|
| + ScopedHandle windowless_shared_section_;
|
| + ScopedBitmap windowless_bitmap_;
|
| + ScopedHDC windowless_hdc_;
|
| + ScopedHandle windowless_buffer_lock_;
|
| };
|
|
|
| #endif // CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__
|
|
|