summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.h
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-04 17:18:18 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-04 17:18:18 +0000
commitf99d9b3f94ac14e7ce6c7ab6513d2de11038f019 (patch)
tree5f697baa4f0679984fb4f4281250e50bcdaadccc /chrome/renderer/render_widget.h
parent33a744250e71d9368451da50455347cf56903f62 (diff)
downloadchromium_src-f99d9b3f94ac14e7ce6c7ab6513d2de11038f019.zip
chromium_src-f99d9b3f94ac14e7ce6c7ab6513d2de11038f019.tar.gz
chromium_src-f99d9b3f94ac14e7ce6c7ab6513d2de11038f019.tar.bz2
Defer window.close(), window.resizeTo(), and window.moveTo()
actions by posting a task back to the message loop before notifying the RenderWidgetHost to perform these operations. Otherwise, the JS code races with the browser to use the modified window. BUG=http://crbug.com/6377 BUG=http://crbug.com/6192 Also, because window resizing is asynchronous between the renderer and browser, added a renderer-side cache of "pending window rect" to ChromeClientImpl. Before the change, calling setWindowRect() would schedule a call to the RenderViewHost to do the work, but a subsequent call to windowRect() would return the current size, as through the call to setWindowRect() had never happened. We cache a pending size and then schedule a task on the message loop to clear the cached size. This allows javascript which writes and reads the WindowRect sizes to work, and once we come out of JS and return to the message loop, we'll go back to asking the RenderViewHost for the true values. This pending_window_size is my only concern about this patch. It does pass all layout tests, and the ChromeClientImpl code is executed in the test_shell.exe code path. BUG=http://crbug.com/835 TEST=LayoutTests have tests which cover all of these actions. The problem is that we run layout tests using the test_shell, not Chrome. Review URL: http://codereview.chromium.org/101019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15214 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.h')
-rw-r--r--chrome/renderer/render_widget.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index 62777e8..eb3575a 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -24,6 +24,10 @@
class RenderThreadBase;
struct WebPluginGeometry;
+namespace WebKit {
+struct WebRect;
+}
+
// RenderWidget provides a communication bridge between a WebWidget and
// a RenderWidgetHost, the latter of which lives in a different process.
class RenderWidget : public IPC::Channel::Listener,
@@ -119,6 +123,8 @@ class RenderWidget : public IPC::Channel::Listener,
void DoDeferredPaint();
void DoDeferredScroll();
+ 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.