summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 14:41:03 +0000
committerojan@chromium.org <ojan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-22 14:41:03 +0000
commit44d7c9d4cbbe8e74c1089fc7334c33d387c6d1ac (patch)
treee0741b37ea82b9ddc5d7429bc783fa711eb4cfbe
parent1ea08fc2ae33438e39fb16febcfd2cb6af7045ae (diff)
downloadchromium_src-44d7c9d4cbbe8e74c1089fc7334c33d387c6d1ac.zip
chromium_src-44d7c9d4cbbe8e74c1089fc7334c33d387c6d1ac.tar.gz
chromium_src-44d7c9d4cbbe8e74c1089fc7334c33d387c6d1ac.tar.bz2
Mark WebViewClient subclasses that return a null layerTreeView.
In a followup blink-side patch, returning a null layerTreeView without returning true from allowsBrokenNullLayerTreeView will assert. Soon, we'll delete the null layerTreeView codepath entirely. This is to make sure we have all the cases identified and so that new ones don't get added. Remove the null-check in RenderWidget::initializeLayerTreeView. It never sets compositor_ to null and on the blink side we assert as such. Review URL: https://codereview.chromium.org/242953005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265252 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--android_webview/renderer/print_web_view_helper.cc9
-rw-r--r--chrome/renderer/printing/print_web_view_helper.cc9
-rw-r--r--components/plugins/renderer/webview_plugin.cc4
-rw-r--r--components/plugins/renderer/webview_plugin.h4
-rw-r--r--content/renderer/render_widget.cc3
5 files changed, 26 insertions, 3 deletions
diff --git a/android_webview/renderer/print_web_view_helper.cc b/android_webview/renderer/print_web_view_helper.cc
index b9d38fd4..006a371 100644
--- a/android_webview/renderer/print_web_view_helper.cc
+++ b/android_webview/renderer/print_web_view_helper.cc
@@ -537,6 +537,11 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
return owns_web_view_ && frame() && frame()->isLoading();
}
+ // TODO(ojan): Remove this override and have this class use a non-null
+ // layerTreeView.
+ // blink::WebViewClient override:
+ virtual bool allowsBrokenNullLayerTreeView() const;
+
protected:
// blink::WebViewClient override:
virtual void didStopLoading();
@@ -671,6 +676,10 @@ void PrepareFrameAndViewForPrint::CopySelection(
frame()->loadRequest(blink::WebURLRequest(GURL(url_str)));
}
+bool PrepareFrameAndViewForPrint::allowsBrokenNullLayerTreeView() const {
+ return true;
+}
+
void PrepareFrameAndViewForPrint::didStopLoading() {
DCHECK(!on_ready_.is_null());
// Don't call callback here, because it can delete |this| and WebView that is
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc
index 2f75442..259601e 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -566,6 +566,11 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
return owns_web_view_ && frame() && frame()->isLoading();
}
+ // TODO(ojan): Remove this override and have this class use a non-null
+ // layerTreeView.
+ // blink::WebViewClient override:
+ virtual bool allowsBrokenNullLayerTreeView() const;
+
protected:
// blink::WebViewClient override:
virtual void didStopLoading();
@@ -701,6 +706,10 @@ void PrepareFrameAndViewForPrint::CopySelection(
frame()->loadRequest(blink::WebURLRequest(GURL(url_str)));
}
+bool PrepareFrameAndViewForPrint::allowsBrokenNullLayerTreeView() const {
+ return true;
+}
+
void PrepareFrameAndViewForPrint::didStopLoading() {
DCHECK(!on_ready_.is_null());
// Don't call callback here, because it can delete |this| and WebView that is
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 6095e2b..b1df67c 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -219,6 +219,10 @@ void WebViewPlugin::startDragging(WebLocalFrame*,
web_view_->dragSourceSystemDragEnded();
}
+bool WebViewPlugin::allowsBrokenNullLayerTreeView() const {
+ return true;
+}
+
void WebViewPlugin::didInvalidateRect(const WebRect& rect) {
if (container_)
container_->invalidateRect(rect);
diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h
index af352ec..8c17c51 100644
--- a/components/plugins/renderer/webview_plugin.h
+++ b/components/plugins/renderer/webview_plugin.h
@@ -116,6 +116,10 @@ class WebViewPlugin : public blink::WebPlugin,
const blink::WebImage& image,
const blink::WebPoint& point);
+ // TODO(ojan): Remove this override and have this class use a non-null
+ // layerTreeView.
+ virtual bool allowsBrokenNullLayerTreeView() const;
+
// WebWidgetClient methods:
virtual void didInvalidateRect(const blink::WebRect&);
virtual void didChangeCursor(const blink::WebCursorInfo& cursor);
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 3a156f3..e126a3f 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1558,9 +1558,6 @@ void RenderWidget::didDeactivateCompositor() {
void RenderWidget::initializeLayerTreeView() {
compositor_ = RenderWidgetCompositor::Create(
this, is_threaded_compositing_enabled_);
- if (!compositor_)
- return;
-
compositor_->setViewportSize(size_, physical_backing_size_);
if (init_complete_)
StartCompositor();