Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "cc/output/compositor_frame_sink.h" | 26 #include "cc/output/compositor_frame_sink.h" |
| 27 #include "cc/output/copy_output_request.h" | 27 #include "cc/output/copy_output_request.h" |
| 28 #include "cc/scheduler/begin_frame_source.h" | 28 #include "cc/scheduler/begin_frame_source.h" |
| 29 #include "content/common/content_switches_internal.h" | 29 #include "content/common/content_switches_internal.h" |
| 30 #include "content/common/input/synthetic_gesture_packet.h" | 30 #include "content/common/input/synthetic_gesture_packet.h" |
| 31 #include "content/common/input_messages.h" | 31 #include "content/common/input_messages.h" |
| 32 #include "content/common/swapped_out_messages.h" | 32 #include "content/common/swapped_out_messages.h" |
| 33 #include "content/common/text_input_state.h" | 33 #include "content/common/text_input_state.h" |
| 34 #include "content/common/view_messages.h" | 34 #include "content/common/view_messages.h" |
| 35 #include "content/public/common/browser_side_navigation_policy.h" | |
| 35 #include "content/public/common/content_features.h" | 36 #include "content/public/common/content_features.h" |
| 36 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 37 #include "content/public/common/context_menu_params.h" | 38 #include "content/public/common/context_menu_params.h" |
| 38 #include "content/renderer/cursor_utils.h" | 39 #include "content/renderer/cursor_utils.h" |
| 39 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" | 40 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" |
| 40 #include "content/renderer/external_popup_menu.h" | 41 #include "content/renderer/external_popup_menu.h" |
| 41 #include "content/renderer/gpu/frame_swap_message_queue.h" | 42 #include "content/renderer/gpu/frame_swap_message_queue.h" |
| 42 #include "content/renderer/gpu/queue_message_swap_promise.h" | 43 #include "content/renderer/gpu/queue_message_swap_promise.h" |
| 43 #include "content/renderer/gpu/render_widget_compositor.h" | 44 #include "content/renderer/gpu/render_widget_compositor.h" |
| 44 #include "content/renderer/ime_event_guard.h" | 45 #include "content/renderer/ime_event_guard.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 bool hidden, | 320 bool hidden, |
| 320 const ScreenInfo& screen_info, | 321 const ScreenInfo& screen_info, |
| 321 CompositorDependencies* compositor_deps, | 322 CompositorDependencies* compositor_deps, |
| 322 blink::WebLocalFrame* frame) { | 323 blink::WebLocalFrame* frame) { |
| 323 CHECK_NE(routing_id, MSG_ROUTING_NONE); | 324 CHECK_NE(routing_id, MSG_ROUTING_NONE); |
| 324 // TODO(avi): Before RenderViewImpl has-a RenderWidget, the browser passes the | 325 // TODO(avi): Before RenderViewImpl has-a RenderWidget, the browser passes the |
| 325 // same routing ID for both the view routing ID and the main frame widget | 326 // same routing ID for both the view routing ID and the main frame widget |
| 326 // routing ID. https://crbug.com/545684 | 327 // routing ID. https://crbug.com/545684 |
| 327 RenderViewImpl* view = RenderViewImpl::FromRoutingID(routing_id); | 328 RenderViewImpl* view = RenderViewImpl::FromRoutingID(routing_id); |
| 328 if (view) { | 329 if (view) { |
| 329 view->AttachWebFrameWidget( | 330 // With PlzNavigate, the widget could already be created by the speculative |
|
dcheng
2016/10/06 02:34:00
I'm a bit confused about this comment. Could you h
jam
2016/10/06 04:33:48
I could be missing something.
The callstack that
jam
2016/10/06 15:09:19
actually, hold off on reviewing this file. I'll wo
alexmos
2016/10/06 22:37:28
The crash that I think you're hitting sounds a lot
jam
2016/10/06 22:54:31
Ah ok, I'll wait for you then.
Also, and perhap
alexmos
2016/10/07 01:47:47
Yes, I added that as a repro to issue 651980, and
| |
| 330 RenderWidget::CreateWebFrameWidget(view->GetWidget(), frame)); | 331 // render frame. |
| 332 if (!IsBrowserSideNavigationEnabled() || !view->GetWebFrameWidget()) { | |
| 333 view->AttachWebFrameWidget( | |
| 334 RenderWidget::CreateWebFrameWidget(view->GetWidget(), frame)); | |
| 335 } | |
| 331 return view->GetWidget(); | 336 return view->GetWidget(); |
| 332 } | 337 } |
| 333 scoped_refptr<RenderWidget> widget( | 338 scoped_refptr<RenderWidget> widget( |
| 334 g_create_render_widget | 339 g_create_render_widget |
| 335 ? g_create_render_widget(compositor_deps, blink::WebPopupTypeNone, | 340 ? g_create_render_widget(compositor_deps, blink::WebPopupTypeNone, |
| 336 screen_info, false, hidden, false) | 341 screen_info, false, hidden, false) |
| 337 : new RenderWidget(compositor_deps, blink::WebPopupTypeNone, | 342 : new RenderWidget(compositor_deps, blink::WebPopupTypeNone, |
| 338 screen_info, false, hidden, false)); | 343 screen_info, false, hidden, false)); |
| 339 widget->SetRoutingID(routing_id); | 344 widget->SetRoutingID(routing_id); |
| 340 widget->for_oopif_ = true; | 345 widget->for_oopif_ = true; |
| (...skipping 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2166 bool RenderWidget::isPointerLocked() { | 2171 bool RenderWidget::isPointerLocked() { |
| 2167 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2172 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 2168 webwidget_mouse_lock_target_.get()); | 2173 webwidget_mouse_lock_target_.get()); |
| 2169 } | 2174 } |
| 2170 | 2175 |
| 2171 blink::WebWidget* RenderWidget::GetWebWidget() const { | 2176 blink::WebWidget* RenderWidget::GetWebWidget() const { |
| 2172 return webwidget_internal_; | 2177 return webwidget_internal_; |
| 2173 } | 2178 } |
| 2174 | 2179 |
| 2175 } // namespace content | 2180 } // namespace content |
| OLD | NEW |