diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/plugins/renderer/webview_plugin.cc | 23 | ||||
-rw-r--r-- | components/plugins/renderer/webview_plugin.h | 2 | ||||
-rw-r--r-- | components/test_runner/test_plugin.h | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc index 2869a77..02d8a0e 100644 --- a/components/plugins/renderer/webview_plugin.cc +++ b/components/plugins/renderer/webview_plugin.cc @@ -131,8 +131,8 @@ bool WebViewPlugin::initialize(WebPluginContainer* container) { // scheduleAnimation, but due to timers controlling widget update, // scheduleAnimation may be invoked before this initialize call (which // comes through the widget update process). It doesn't hurt to mark - // for layout again, and it does help us in the race-condition situation. - container_->setNeedsLayout(); + // for animation again, and it does help us in the race-condition situation. + container_->scheduleAnimation(); old_title_ = container_->element().getAttribute("title"); @@ -161,9 +161,7 @@ v8::Local<v8::Object> WebViewPlugin::v8ScriptableObject(v8::Isolate* isolate) { return delegate_->GetV8ScriptableObject(isolate); } -// TODO(wkorman): Look into renaming this to something more in line with -// either the Blink lifecycle or Compositor layer tree host nomenclature. -void WebViewPlugin::layoutIfNeeded() { +void WebViewPlugin::updateAllLifecyclePhases() { web_view_->updateAllLifecyclePhases(); } @@ -293,8 +291,19 @@ void WebViewPlugin::didChangeCursor(const WebCursorInfo& cursor) { } void WebViewPlugin::scheduleAnimation() { - if (container_) - container_->setNeedsLayout(); + // Resizes must be self-contained: any lifecycle updating must + // be triggerd from within the WebView or this WebViewPlugin. + // This is because this WebViewPlugin is contained in another + // Web View which may be in the middle of updating its lifecycle, + // but after layout is done, and it is illegal to dirty earlier + // lifecycle stages during later ones. + if (is_resizing_) + return; + if (container_) { + // This should never happen; see also crbug.com/545039 for context. + CHECK(!is_painting_); + container_->scheduleAnimation(); + } } void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h index 20fa038..713ed659 100644 --- a/components/plugins/renderer/webview_plugin.h +++ b/components/plugins/renderer/webview_plugin.h @@ -88,7 +88,7 @@ class WebViewPlugin : public blink::WebPlugin, v8::Local<v8::Object> v8ScriptableObject(v8::Isolate* isolate) override; - void layoutIfNeeded() override; + void updateAllLifecyclePhases() override; void paint(blink::WebCanvas* canvas, const blink::WebRect& rect) override; // Coordinates are relative to the containing window. diff --git a/components/test_runner/test_plugin.h b/components/test_runner/test_plugin.h index 55c2832..65b60e4 100644 --- a/components/test_runner/test_plugin.h +++ b/components/test_runner/test_plugin.h @@ -63,7 +63,7 @@ class TestPlugin : public blink::WebPlugin, public cc::TextureLayerClient { NPObject* scriptableObject() override; bool canProcessDrag() const override; bool supportsKeyboardFocus() 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, |