summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/renderer/render_view.cc8
-rw-r--r--chrome/renderer/render_view.h3
-rw-r--r--chrome/renderer/render_widget.cc3
-rw-r--r--chrome/renderer/render_widget.h4
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc67
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h5
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.h2
-rw-r--r--webkit/glue/webplugin_delegate.h2
-rw-r--r--webkit/glue/webplugin_impl.cc5
9 files changed, 28 insertions, 71 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 4e0ec16..7882860 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2507,14 +2507,6 @@ void RenderView::OnSetAltErrorPageURL(const GURL& url) {
alternate_error_page_url_ = url;
}
-void RenderView::DidPaint() {
- PluginDelegateList::iterator it = plugin_delegates_.begin();
- while (it != plugin_delegates_.end()) {
- (*it)->FlushGeometryUpdates();
- ++it;
- }
-}
-
void RenderView::OnInstallMissingPlugin() {
// This could happen when the first default plugin is deleted.
if (first_default_plugin_ == NULL)
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index bd216ae..926ea72 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -604,9 +604,6 @@ class RenderView : public RenderWidget,
// UI that is going to be hosted by this RenderView.
void CreateDevToolsClient();
- // Called by RenderWidget after it paints.
- virtual void DidPaint();
-
// Locates a sub frame with given xpath
WebFrame* GetChildFrame(const std::wstring& frame_xpath) const;
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 25afdbb..5332d74 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -336,9 +336,6 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
// Flush to underlying bitmap. TODO(darin): is this needed?
canvas->getTopPlatformDevice().accessBitmap(false);
-
- // Let the subclass observe this paint operations.
- DidPaint();
}
void RenderWidget::DoDeferredPaint() {
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index a337f54..440a7e2 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -123,10 +123,6 @@ class RenderWidget : public IPC::Channel::Listener,
void DoDeferredClose();
void DoDeferredSetWindowRect(const WebKit::WebRect& pos);
- // This method is called immediately after PaintRect but before the
- // corresponding paint or scroll message is send to the widget host.
- virtual void DidPaint() {}
-
// Set the background of the render widget to a bitmap. The bitmap will be
// tiled in both directions if it isn't big enough to fill the area. This is
// mainly intended to be used in conjuction with WebView::SetIsTransparent().
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 5b16ce6..b00687c 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -165,7 +165,6 @@ WebPluginDelegateProxy::WebPluginDelegateProxy(const std::string& mime_type,
windowless_(false),
mime_type_(mime_type),
clsid_(clsid),
- send_deferred_update_geometry_(false),
npobject_(NULL),
window_script_object_(NULL),
sad_plugin_(NULL),
@@ -204,17 +203,6 @@ void WebPluginDelegateProxy::PluginDestroyed() {
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-void WebPluginDelegateProxy::FlushGeometryUpdates() {
- if (send_deferred_update_geometry_) {
- send_deferred_update_geometry_ = false;
- Send(new PluginMsg_UpdateGeometry(instance_id_,
- plugin_rect_,
- deferred_clip_rect_,
- TransportDIB::Id(),
- TransportDIB::Id()));
- }
-}
-
bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn,
char** argv, int argc,
WebPlugin* plugin,
@@ -372,46 +360,43 @@ void WebPluginDelegateProxy::UpdateGeometry(
const gfx::Rect& window_rect,
const gfx::Rect& clip_rect) {
plugin_rect_ = window_rect;
- if (!windowless_) {
- deferred_clip_rect_ = clip_rect;
- send_deferred_update_geometry_ = true;
- return;
- }
// Be careful to explicitly call the default constructors for these ids,
// as they can be POD on some platforms and we want them initialized.
TransportDIB::Id transport_store_id = TransportDIB::Id();
TransportDIB::Id background_store_id = TransportDIB::Id();
+ if (windowless_) {
#if defined(OS_WIN)
- // TODO(port): use TransportDIB instead of allocating these directly.
- if (!backing_store_canvas_.get() ||
- (window_rect.width() != backing_store_canvas_->getDevice()->width() ||
- window_rect.height() != backing_store_canvas_->getDevice()->height())) {
- // Create a shared memory section that the plugin paints into
- // asynchronously.
- ResetWindowlessBitmaps();
- if (!window_rect.IsEmpty()) {
- if (!CreateBitmap(&backing_store_, &backing_store_canvas_) ||
- !CreateBitmap(&transport_store_, &transport_store_canvas_) ||
- (transparent_ &&
- !CreateBitmap(&background_store_, &background_store_canvas_))) {
- DCHECK(false);
- ResetWindowlessBitmaps();
- return;
+ // TODO(port): use TransportDIB instead of allocating these directly.
+ if (!backing_store_canvas_.get() ||
+ (window_rect.width() != backing_store_canvas_->getDevice()->width() ||
+ window_rect.height() != backing_store_canvas_->getDevice()->height())) {
+ // Create a shared memory section that the plugin paints into
+ // asynchronously.
+ ResetWindowlessBitmaps();
+ if (!window_rect.IsEmpty()) {
+ if (!CreateBitmap(&backing_store_, &backing_store_canvas_) ||
+ !CreateBitmap(&transport_store_, &transport_store_canvas_) ||
+ (transparent_ &&
+ !CreateBitmap(&background_store_, &background_store_canvas_))) {
+ DCHECK(false);
+ ResetWindowlessBitmaps();
+ return;
+ }
+
+ // TODO(port): once we use TransportDIB we will properly fill in these
+ // ids; for now we just fill in the HANDLE field.
+ transport_store_id.handle = transport_store_->handle();
+ if (background_store_.get())
+ background_store_id.handle = background_store_->handle();
}
-
- // TODO(port): once we use TransportDIB we will properly fill in these
- // ids; for now we just fill in the HANDLE field.
- transport_store_id.handle = transport_store_->handle();
- if (background_store_.get())
- background_store_id.handle = background_store_->handle();
}
- }
#else
- // TODO(port): refactor our allocation of backing stores.
- NOTIMPLEMENTED();
+ // TODO(port): refactor our allocation of backing stores.
+ NOTIMPLEMENTED();
#endif
+ }
IPC::Message* msg = new PluginMsg_UpdateGeometry(
instance_id_, window_rect, clip_rect,
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 257a5aaa..3b8d616 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -48,9 +48,6 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
// Called to drop our pointer to the window script object.
void DropWindowScriptObject() { window_script_object_ = NULL; }
- // Called to flush any deferred geometry changes to the plugin process.
- virtual void FlushGeometryUpdates();
-
// WebPluginDelegate implementation:
virtual void PluginDestroyed();
virtual bool Initialize(const GURL& url, char** argn, char** argv, int argc,
@@ -174,8 +171,6 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
FilePath plugin_path_;
gfx::Rect plugin_rect_;
- gfx::Rect deferred_clip_rect_;
- bool send_deferred_update_geometry_;
NPObject* npobject_;
NPObjectStub* window_script_object_;
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h
index aa856b4..61a41cd 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.h
+++ b/webkit/glue/plugins/webplugin_delegate_impl.h
@@ -61,8 +61,6 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
virtual void DidFinishLoadWithReason(NPReason reason);
virtual int GetProcessId();
- virtual void FlushGeometryUpdates() {
- }
virtual void SendJavaScriptStream(const std::string& url,
const std::wstring& result,
bool success, bool notify_needed,
diff --git a/webkit/glue/webplugin_delegate.h b/webkit/glue/webplugin_delegate.h
index ec42432..385044d 100644
--- a/webkit/glue/webplugin_delegate.h
+++ b/webkit/glue/webplugin_delegate.h
@@ -101,8 +101,6 @@ class WebPluginDelegate {
// Returns the process id of the process that is running the plugin.
virtual int GetProcessId() = 0;
- virtual void FlushGeometryUpdates() = 0;
-
// The result of the script execution is returned via this function.
virtual void SendJavaScriptStream(const std::string& url,
const std::wstring& result,
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 11f629d..04d8c79 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -235,7 +235,6 @@ void WebPluginContainer::setParent(WebCore::ScrollView* view) {
WebCore::Widget::setParent(view);
if (view) {
impl_->setFrameRect(frameRect());
- impl_->delegate_->FlushGeometryUpdates();
}
}
@@ -682,7 +681,8 @@ void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) {
webkit_glue::FromIntRect(clip_rect));
// Initiate a download on the plugin url. This should be done for the
- // first update geometry sequence.
+ // first update geometry sequence. We need to ensure that the plugin
+ // receives the geometry update before it starts receiving data.
if (first_geometry_update_) {
first_geometry_update_ = false;
// An empty url corresponds to an EMBED tag with no src attribute.
@@ -1294,7 +1294,6 @@ bool WebPluginImpl::ReinitializePluginForResponse(
// Force a geometry update to occur to ensure that the plugin becomes
// visible.
widget_->frameRectsChanged();
- delegate_->FlushGeometryUpdates();
// The plugin move sequences accumulated via DidMove are sent to the browser
// whenever the renderer paints. Force a paint here to ensure that changes
// to the plugin window are propagated to the browser.