Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 8951014: Change the DidChangeView update to take a new ViewChanged resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/ppapi_plugin_instance.h
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 2dfc21d76b67ca8f2d7556beb117305f2dfc81d7..ee6b437cf6ba7be165f320d8dfe921324340d41a 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -24,6 +24,7 @@
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/shared_impl/function_group_base.h"
#include "ppapi/shared_impl/ppb_instance_shared.h"
+#include "ppapi/shared_impl/ppb_view_shared.h"
#include "ppapi/thunk/ppb_instance_api.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h"
@@ -85,10 +86,13 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
public ::ppapi::PPB_Instance_Shared {
public:
// Create and return a PluginInstance object which supports the
- // PPP_Instance_1_0 interface.
+ // given version.
static PluginInstance* Create1_0(PluginDelegate* delegate,
PluginModule* module,
const void* ppp_instance_if_1_0);
+ static PluginInstance* Create1_1(PluginDelegate* delegate,
+ PluginModule* module,
+ const void* ppp_instance_if_1_1);
// Delete should be called by the WebPlugin before this destructor.
virtual ~PluginInstance();
@@ -99,9 +103,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
WebKit::WebPluginContainer* container() const { return container_; }
- const gfx::Rect& position() const { return position_; }
- const gfx::Rect& clip() const { return clip_; }
-
void set_always_on_top(bool on_top) { always_on_top_ = on_top; }
// Returns the PP_Instance uniquely identifying this instance. Guaranteed
@@ -144,6 +145,7 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// PPB_Instance and PPB_Instance_Private implementation.
const GURL& plugin_url() const { return plugin_url_; }
bool full_frame() const { return full_frame_; }
+ const ::ppapi::ViewData& view_data() const { return view_data_; }
// If |type| is not PP_CURSORTYPE_CUSTOM, |custom_image| and |hot_spot| are
// ignored.
bool SetCursor(PP_CursorType_Dev type,
@@ -306,6 +308,8 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
virtual PP_Bool BindGraphics(PP_Instance instance,
PP_Resource device) OVERRIDE;
virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE;
+ virtual PP_Resource GetView(PP_Instance instance) OVERRIDE;
+ virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE;
virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE;
virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE;
virtual PP_Var ExecuteScript(PP_Instance instance,
@@ -329,7 +333,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
PP_Bool fullscreen) OVERRIDE;
virtual PP_Bool FlashGetScreenSize(PP_Instance instance,
PP_Size* size) OVERRIDE;
- virtual PP_Bool IsFullscreen(PP_Instance instance) OVERRIDE;
virtual PP_Bool SetFullscreen(PP_Instance instance,
PP_Bool fullscreen) OVERRIDE;
virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size)
@@ -384,6 +387,10 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// (see has_webkit_focus_ below).
bool PluginHasFocus() const;
+ void ScheduleAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
+ void SendAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
+ void SendDidChangeView(const ::ppapi::ViewData& previous_view);
+
// Reports the current plugin geometry to the plugin by calling
// DidChangeView.
void ReportGeometry();
@@ -444,9 +451,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// compositing path.
bool IsViewAccelerated();
- // Remember view parameters that were sent to the plugin.
- void SetSentDidChangeView(const gfx::Rect& position, const gfx::Rect& clip);
-
// Track, set and reset size attributes to control the size of the plugin
// in and out of fullscreen mode.
void KeepSizeAttributesBeforeFullscreen();
@@ -469,20 +473,19 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
// an entire document rather than an embed tag.
bool full_frame_;
+ // Stores the current state of the plugin view.
+ ::ppapi::ViewData view_data_;
+
// Indicates if we've ever sent a didChangeView to the plugin. This ensure we
// always send an initial notification, even if the position and clip are the
// same as the default values.
bool sent_did_change_view_;
- // Position in the viewport (which moves as the page is scrolled) of this
- // plugin. This will be a 0-sized rectangle if the plugin has not yet been
- // laid out.
- gfx::Rect position_;
-
- // Current clip rect. This will be empty if the plugin is not currently
- // visible. This is in the plugin's coordinate system, so fully visible will
- // be (0, 0, w, h) regardless of scroll position.
- gfx::Rect clip_;
+ // Set to true when we've scheduled an asynchronous DidChangeView update for
+ // the purposes of consolidating updates. When this is set, code should
+ // update the view_data_ but not send updates. It will be cleared once the
+ // asynchronous update has been sent out.
+ bool suppress_did_change_view_;
// The current device context for painting in 2D or 3D.
scoped_refptr< ::ppapi::Resource> bound_graphics_;

Powered by Google App Engine
This is Rietveld 408576698