summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorJason Kersey <kerz@google.com>2016-03-07 20:21:16 -0800
committerJason Kersey <kerz@google.com>2016-03-08 04:22:58 +0000
commitb67631a9671ebab418020cb52d42f4681e7bdc2b (patch)
treed612dd8989b78f688fffef080c8941f5bb7ffc51 /content
parent890056bc883ac82c7a51fb7a614de3a509a177e7 (diff)
downloadchromium_src-b67631a9671ebab418020cb52d42f4681e7bdc2b.zip
chromium_src-b67631a9671ebab418020cb52d42f4681e7bdc2b.tar.gz
chromium_src-b67631a9671ebab418020cb52d42f4681e7bdc2b.tar.bz2
Decouple scheduling animation of webview plugins from layout.
Previously, any time the webview plugin needed to schedule animation, it dirtied layout in the containing frame. This was because it used to be the case that LayoutEmbeddedObject would run the webview plugin's lifecycle as part of layout. However, this is not right, for two reasons: 1. A lifecycle update for later phases may be needed for the plugin due to changes in the parent, even if layout is not dirty. This can lead to not running the webview lifecyle in some cases. https://codereview.chromium.org/1708923002 fixed this by always running the lifecycle of the webview plugin when the parent does. 2. Animation is scheduled for two reasons: lifecyle update, and actual animations, such as issuing resize events to script. It is valid to queue up async script events during a lifecycle update. (In one case in the referenced bug, FrameView:: sendResizeEventIfNeeded does this when it notices that layout changed the size of the frame). This CL fixes cases such as that, and builds up on the one fixing issue #1, by scheduling animation of the parent frame but not dirtying layout. BUG=590856 TBR=tommycli,fsamuel Review URL: https://codereview.chromium.org/1774653002 Cr-Commit-Position: refs/heads/master@{#379694} (cherry picked from commit 78ea22a8529ec7ac2ea07d7e69ddd1446f0ed262) Review URL: https://codereview.chromium.org/1770913004 . Cr-Commit-Position: refs/branch-heads/2623@{#594} Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
Diffstat (limited to 'content')
-rw-r--r--content/renderer/browser_plugin/browser_plugin.h2
-rw-r--r--content/renderer/npapi/webplugin_impl.cc2
-rw-r--r--content/renderer/npapi/webplugin_impl.h2
-rw-r--r--content/renderer/pepper/pepper_webplugin_impl.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index 79907df..b166f5e 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -88,7 +88,7 @@ class CONTENT_EXPORT BrowserPlugin :
bool supportsEditCommands() const override;
bool supportsInputMethod() const override;
bool canProcessDrag() const override;
- void layoutIfNeeded() override {}
+ void updateAllLifecyclePhases() override {}
void paint(blink::WebCanvas* canvas, const blink::WebRect& rect) override;
void updateGeometry(const blink::WebRect& window_rect,
const blink::WebRect& clip_rect,
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index f5b0273..cfa4f29 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -308,7 +308,7 @@ bool WebPluginImpl::getFormValue(blink::WebString& value) {
return true;
}
-void WebPluginImpl::layoutIfNeeded() {
+void WebPluginImpl::updateAllLifecyclePhases() {
if (!container_)
return;
diff --git a/content/renderer/npapi/webplugin_impl.h b/content/renderer/npapi/webplugin_impl.h
index a7408cb..108d1b5 100644
--- a/content/renderer/npapi/webplugin_impl.h
+++ b/content/renderer/npapi/webplugin_impl.h
@@ -76,7 +76,7 @@ class WebPluginImpl : public WebPlugin,
NPObject* scriptableObject() override;
struct _NPP* pluginNPP() override;
bool getFormValue(blink::WebString& value) override;
- void layoutIfNeeded() override;
+ void updateAllLifecyclePhases() override;
void paint(blink::WebCanvas* canvas,
const blink::WebRect& paint_rect) override;
void updateGeometry(const blink::WebRect& window_rect,
diff --git a/content/renderer/pepper/pepper_webplugin_impl.h b/content/renderer/pepper/pepper_webplugin_impl.h
index d8ee01d..65641ea 100644
--- a/content/renderer/pepper/pepper_webplugin_impl.h
+++ b/content/renderer/pepper/pepper_webplugin_impl.h
@@ -46,7 +46,7 @@ class PepperWebPluginImpl : public blink::WebPlugin {
void destroy() override;
v8::Local<v8::Object> v8ScriptableObject(v8::Isolate* isolate) override;
bool getFormValue(blink::WebString& value) override;
- void layoutIfNeeded() override {}
+ void updateAllLifecyclePhases() override {}
void paint(blink::WebCanvas* canvas, const blink::WebRect& rect) override;
void updateGeometry(const blink::WebRect& window_rect,
const blink::WebRect& clip_rect,