| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ | 5 #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ |
| 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ | 6 #define CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/gfx/rect.h" | 11 #include "base/gfx/rect.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/scoped_handle.h" | 13 #include "base/scoped_handle.h" |
| 14 #include "chrome/common/ipc_message.h" | 14 #include "chrome/common/ipc_message.h" |
| 15 #include "chrome/common/plugin_messages.h" | 15 #include "chrome/common/plugin_messages.h" |
| 16 #include "chrome/plugin/npobject_stub.h" | 16 #include "chrome/plugin/npobject_stub.h" |
| 17 #include "chrome/renderer/plugin_channel_host.h" | 17 #include "chrome/renderer/plugin_channel_host.h" |
| 18 #include "webkit/glue/webplugin.h" | 18 #include "webkit/glue/webplugin.h" |
| 19 #include "webkit/glue/webplugin_delegate.h" | 19 #include "webkit/glue/webplugin_delegate.h" |
| 20 | 20 |
| 21 class GURL; | 21 class GURL; |
| 22 struct PluginHostMsg_RouteToFrame_Params; | 22 struct PluginHostMsg_RouteToFrame_Params; |
| 23 class RenderView; | 23 class RenderView; |
| 24 class SkBitmap; | 24 class SkBitmap; |
| 25 | 25 |
| 26 namespace base { |
| 27 class WaitableEvent; |
| 28 } |
| 29 |
| 26 namespace skia { | 30 namespace skia { |
| 27 class PlatformCanvasWin; | 31 class PlatformCanvasWin; |
| 28 } | 32 } |
| 29 | 33 |
| 30 // An implementation of WebPluginDelegate that proxies all calls to | 34 // An implementation of WebPluginDelegate that proxies all calls to |
| 31 // the plugin process. | 35 // the plugin process. |
| 32 class WebPluginDelegateProxy : public WebPluginDelegate, | 36 class WebPluginDelegateProxy : public WebPluginDelegate, |
| 33 public IPC::Channel::Listener, | 37 public IPC::Channel::Listener, |
| 34 public IPC::Message::Sender { | 38 public IPC::Message::Sender { |
| 35 public: | 39 public: |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 gfx::Rect deferred_clip_rect_; | 164 gfx::Rect deferred_clip_rect_; |
| 161 std::vector<gfx::Rect> deferred_cutout_rects_; | 165 std::vector<gfx::Rect> deferred_cutout_rects_; |
| 162 bool send_deferred_update_geometry_; | 166 bool send_deferred_update_geometry_; |
| 163 bool visible_; | 167 bool visible_; |
| 164 | 168 |
| 165 NPObject* npobject_; | 169 NPObject* npobject_; |
| 166 NPObjectStub* window_script_object_; | 170 NPObjectStub* window_script_object_; |
| 167 | 171 |
| 168 // Event passed in by the plugin process and is used to decide if | 172 // Event passed in by the plugin process and is used to decide if |
| 169 // messages need to be pumped in the NPP_HandleEvent sync call. | 173 // messages need to be pumped in the NPP_HandleEvent sync call. |
| 170 ScopedHandle modal_loop_pump_messages_event_; | 174 scoped_ptr<base::WaitableEvent> modal_loop_pump_messages_event_; |
| 171 | 175 |
| 172 // Bitmap for crashed plugin | 176 // Bitmap for crashed plugin |
| 173 SkBitmap* sad_plugin_; | 177 SkBitmap* sad_plugin_; |
| 174 | 178 |
| 175 // True if we got an invalidate from the plugin and are waiting for a paint. | 179 // True if we got an invalidate from the plugin and are waiting for a paint. |
| 176 bool invalidate_pending_; | 180 bool invalidate_pending_; |
| 177 | 181 |
| 178 // Used to desynchronize windowless painting. When WebKit paints, we bitblt | 182 // Used to desynchronize windowless painting. When WebKit paints, we bitblt |
| 179 // from our backing store of what the plugin rectangle looks like. The | 183 // from our backing store of what the plugin rectangle looks like. The |
| 180 // plugin paints into the transport store, and we copy that to our backing | 184 // plugin paints into the transport store, and we copy that to our backing |
| 181 // store when we get an invalidate from it. The background bitmap is used | 185 // store when we get an invalidate from it. The background bitmap is used |
| 182 // for transparent plugins, as they need the backgroud data during painting. | 186 // for transparent plugins, as they need the backgroud data during painting. |
| 183 bool transparent_; | 187 bool transparent_; |
| 184 scoped_ptr<base::SharedMemory> backing_store_; | 188 scoped_ptr<base::SharedMemory> backing_store_; |
| 185 scoped_ptr<skia::PlatformCanvasWin> backing_store_canvas_; | 189 scoped_ptr<skia::PlatformCanvasWin> backing_store_canvas_; |
| 186 scoped_ptr<base::SharedMemory> transport_store_; | 190 scoped_ptr<base::SharedMemory> transport_store_; |
| 187 scoped_ptr<skia::PlatformCanvasWin> transport_store_canvas_; | 191 scoped_ptr<skia::PlatformCanvasWin> transport_store_canvas_; |
| 188 scoped_ptr<base::SharedMemory> background_store_; | 192 scoped_ptr<base::SharedMemory> background_store_; |
| 189 scoped_ptr<skia::PlatformCanvasWin> background_store_canvas_; | 193 scoped_ptr<skia::PlatformCanvasWin> background_store_canvas_; |
| 190 // This lets us know which portion of the backing store has been painted into. | 194 // This lets us know which portion of the backing store has been painted into. |
| 191 gfx::Rect backing_store_painted_; | 195 gfx::Rect backing_store_painted_; |
| 192 | 196 |
| 193 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateProxy); | 197 DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateProxy); |
| 194 }; | 198 }; |
| 195 | 199 |
| 196 #endif // #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ | 200 #endif // #ifndef CHROME_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H__ |
| 197 | 201 |
| OLD | NEW |