diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 04:55:58 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 04:55:58 +0000 |
commit | f0b851441ccfad4a399f3b000739301618ffece3 (patch) | |
tree | 19f6d902b1c01bf435829bb38a80db056c9120ad | |
parent | 08518a73423b16e5f0762b65c87604f4495618b6 (diff) | |
download | chromium_src-f0b851441ccfad4a399f3b000739301618ffece3.zip chromium_src-f0b851441ccfad4a399f3b000739301618ffece3.tar.gz chromium_src-f0b851441ccfad4a399f3b000739301618ffece3.tar.bz2 |
Revert r5816 due to InvokeMethods failures in test_shell_tests.
Review URL: http://codereview.chromium.org/11342
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5818 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/plugin/webplugin_proxy.cc | 28 | ||||
-rw-r--r-- | chrome/plugin/webplugin_proxy.h | 5 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 3 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_np_utils.cpp | 5 |
5 files changed, 9 insertions, 34 deletions
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 255c843..2cbb3ee 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -34,9 +34,7 @@ WebPluginProxy::WebPluginProxy( window_npobject_(NULL), plugin_element_(NULL), delegate_(delegate), - waiting_for_paint_(false), -#pragma warning(suppress: 4355) // can use this - runnable_method_factory_(this) { + waiting_for_paint_(false) { HANDLE event; BOOL result = DuplicateHandle(channel->renderer_handle(), @@ -86,22 +84,21 @@ void WebPluginProxy::Invalidate() { } void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { - damaged_rect_ = damaged_rect_.Union(rect); // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an // invalidate if it's outside the clipping region, since if we did it won't // lead to a paint and we'll be stuck waiting forever for a DidPaint response. if (rect.IsEmpty() || !delegate_->clip_rect().Intersects(rect)) return; + damaged_rect_ = damaged_rect_.Union(rect); // Only send a single InvalidateRect message at a time. From DidPaint we // will dispatch an additional InvalidateRect message if necessary. if (!waiting_for_paint_) { waiting_for_paint_ = true; - // Invalidates caused by calls to NPN_InvalidateRect/NPN_InvalidateRgn - // need to be painted asynchronously as per the NPAPI spec. - MessageLoop::current()->PostTask(FROM_HERE, - runnable_method_factory_.NewRunnableMethod( - &WebPluginProxy::OnPaint, damaged_rect_)); + // Paint to the plugin bitmap and let the renderer know so it can update + // its backing store. + Paint(damaged_rect_); + Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect_)); damaged_rect_ = gfx::Rect(); } } @@ -285,8 +282,6 @@ void WebPluginProxy::UpdateGeometry( const base::SharedMemoryHandle& windowless_buffer, const base::SharedMemoryHandle& background_buffer) { gfx::Rect old = delegate_->rect(); - gfx::Rect old_clip_rect = delegate_->clip_rect(); - bool moved = delegate_->rect().x() != window_rect.x() || delegate_->rect().y() != window_rect.y(); delegate_->UpdateGeometry(window_rect, clip_rect, cutout_rects, visible); @@ -297,12 +292,6 @@ void WebPluginProxy::UpdateGeometry( // The plugin moved, so update our world transform. UpdateTransform(); } - // Send over any pending invalidates which occured when the plugin was - // off screen. - if (visible && delegate_->windowless() && !clip_rect.IsEmpty() && - old_clip_rect.IsEmpty() && !damaged_rect_.IsEmpty()) { - InvalidateRect(damaged_rect_); - } } void WebPluginProxy::SetWindowlessBuffer( @@ -387,8 +376,3 @@ void WebPluginProxy::InitiateHTTPRangeRequest(const char* url, range_info, existing_stream, notify_needed, notify_data)); } - -void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { - Paint(damaged_rect); - Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); -} diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index c2cefc7..e6a231d 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -108,9 +108,6 @@ class WebPluginProxy : public WebPlugin { ScopedBitmap* bitmap, ScopedHDC* hdc); - // Handler for sending over the paint event to the plugin. - void OnPaint(const gfx::Rect& damaged_rect); - // Called when a plugin's origin moves, so that we can update the world // transform of the local HDC. void UpdateTransform(); @@ -140,8 +137,6 @@ class WebPluginProxy : public WebPlugin { ScopedHandle background_shared_section_; ScopedBitmap background_bitmap_; ScopedHDC background_hdc_; - - ScopedRunnableMethodFactory<WebPluginProxy> runnable_method_factory_; }; #endif // CHROME_PLUGIN_PLUGIN_WEBPLUGIN_PROXY_H__ diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 4d915cc..5edcae4 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -656,7 +656,7 @@ void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { delegate_->UpdateGeometry( webkit_glue::FromIntRect(window_rect), webkit_glue::FromIntRect(clip_rect), cutout_rects, - windowless_ || received_first_paint_notification_ ? visible_ : false); + received_first_paint_notification_? visible_ : false); // delegate_ can go away as a result of above call, so check it first. if (force_geometry_update_ && delegate_) { diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index 3cc60ed..e16f1b6 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -305,8 +305,7 @@ class WebPluginImpl : public WebPlugin, WebPluginDelegate* delegate_; bool force_geometry_update_; bool visible_; - // Set when we receive the first paint notification for a windowed - // plugin widget. + // Set when we receive the first paint notification for the plugin widget. bool received_first_paint_notification_; WebPluginContainer* widget_; diff --git a/webkit/port/bindings/v8/v8_np_utils.cpp b/webkit/port/bindings/v8/v8_np_utils.cpp index 74f5bd6..287d268 100644 --- a/webkit/port/bindings/v8/v8_np_utils.cpp +++ b/webkit/port/bindings/v8/v8_np_utils.cpp @@ -53,10 +53,7 @@ void ConvertV8ObjectToNPVariant(v8::Local<v8::Value> object, NPObject *owner, if (object.IsEmpty()) return; - if (object->IsInt32()) { - INT32_TO_NPVARIANT(object->NumberValue(), *result); - - } else if (object->IsNumber()) { + if (object->IsNumber()) { DOUBLE_TO_NPVARIANT(object->NumberValue(), *result); } else if (object->IsBoolean()) { |