Revert "Move some of VisualProperties to RenderWidget::Init()."
This reverts commit 628bdce65237022927e4694d55cb4df8fd0af297.
Reason for revert: virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi.html started failing on WebKit Mac10.13 (retina) and this patch is on the blame list and seems related. Output isn't that useful, other than to say golden images don't match:
9:34:53.543 49202 "/b/s/w/ir/out/Release/image_diff --diff /b/s/w/itqSin9p/tmp_EMj8D/actual.png /b/s/w/itqSin9p/tmp_EMj8D/expected.png /b/s/w/itqSin9p/tmp_EMj8D/diff.png" took 0.20s
09:34:53.546 49154 [1087/5973] virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi.html failed unexpectedly (image diff)
09:34:53.545 49202 worker/6 virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi.html failed:
Original change's description:
> Move some of VisualProperties to RenderWidget::Init().
>
> VisualProperties are passed to the RenderViewImpl::Create() method via
> the IPC params, then are passed along to the RenderWidget, but in a
> lot of different steps.
>
> 1st, screen info is passed to the RenderWidget constructor.
> 2nd, the display mode is set directly on the RenderWidget.
> [ a bunch of other initialization here ]
> 3rd, the whole set of properties is passed to
> OnSynchronizeVisualProperties like an IPC was just received.
>
> The 3rd step sends the screen info and the display mode again, though
> they won't be changed of course.
>
> This combines step 1 and 2 into one step where they are passed to the
> RenderWidget::Init() method. Then we can look at combining with step 3.
>
> R=[email protected], [email protected]
>
> Bug: 419087
> Change-Id: Ifcb8eaa0915bb235172e8c5b7bee188e863c18c3
> Reviewed-on: https://chromium-review.googlesource.com/1150673
> Commit-Queue: danakj <[email protected]>
> Reviewed-by: Albert J. Wong <[email protected]>
> Reviewed-by: Avi Drissman <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#578660}
[email protected],[email protected],[email protected]
Change-Id: Ife47ce2124a0a5baffaa2dd08b3dfe7de79cc568
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 419087, 868444
Reviewed-on: https://chromium-review.googlesource.com/1153398
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/master@{#578694}
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index f86b234..e2f4005 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -390,6 +390,7 @@
int32_t widget_routing_id,
CompositorDependencies* compositor_deps,
blink::WebPopupType popup_type,
+ const ScreenInfo& screen_info,
bool swapped_out,
bool hidden,
bool never_visible,
@@ -417,6 +418,7 @@
composition_range_(gfx::Range::InvalidRange()),
popup_type_(popup_type),
pending_window_rect_count_(0),
+ screen_info_(screen_info),
monitor_composition_info_(false),
popup_origin_scale_for_emulation_(0.f),
frame_swap_message_queue_(new FrameSwapMessageQueue(routing_id_)),
@@ -512,13 +514,13 @@
return nullptr;
}
- scoped_refptr<RenderWidget> widget(
- new RenderWidget(routing_id, compositor_deps, popup_type, false, false,
- false, task_runner, std::move(widget_channel_request)));
+ scoped_refptr<RenderWidget> widget(new RenderWidget(
+ routing_id, compositor_deps, popup_type, screen_info, false, false, false,
+ task_runner, std::move(widget_channel_request)));
ShowCallback opener_callback = base::BindOnce(
&RenderViewImpl::ShowCreatedPopupWidget, opener->GetWeakPtr());
- widget->Init(std::move(opener_callback), blink::kWebDisplayModeUndefined,
- screen_info, RenderWidget::CreateWebWidget(widget.get()));
+ widget->Init(std::move(opener_callback),
+ RenderWidget::CreateWebWidget(widget.get()));
DCHECK(!widget->HasOneRef()); // RenderWidget::Init() adds a reference.
return widget.get();
}
@@ -552,16 +554,15 @@
scoped_refptr<RenderWidget> widget(
g_create_render_widget
? g_create_render_widget(widget_routing_id, compositor_deps,
- blink::kWebPopupTypeNone, false, hidden,
- false)
+ blink::kWebPopupTypeNone, screen_info, false,
+ hidden, false)
: new RenderWidget(widget_routing_id, compositor_deps,
- blink::kWebPopupTypeNone, false, hidden, false,
- task_runner));
+ blink::kWebPopupTypeNone, screen_info, false,
+ hidden, false, task_runner));
widget->for_oopif_ = true;
// Init increments the reference count on |widget|, keeping it alive after
// this function returns.
- widget->Init(base::NullCallback(), blink::kWebDisplayModeUndefined,
- screen_info,
+ widget->Init(base::NullCallback(),
RenderWidget::CreateWebFrameWidget(widget.get(), frame));
widget->UpdateWebViewWithDeviceScaleFactor();
@@ -612,15 +613,10 @@
RenderProcess::current()->AddRefProcess();
}
-void RenderWidget::Init(ShowCallback show_callback,
- const blink::WebDisplayMode& display_mode,
- const ScreenInfo& screen_info,
- WebWidget* web_widget) {
+void RenderWidget::Init(ShowCallback show_callback, WebWidget* web_widget) {
DCHECK(!webwidget_internal_);
DCHECK_NE(routing_id_, MSG_ROUTING_NONE);
- display_mode_ = display_mode;
- screen_info_ = screen_info;
input_handler_ = std::make_unique<RenderWidgetInputHandler>(this, this);
RenderThreadImpl* render_thread_impl = RenderThreadImpl::current();