Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 2112923002: Fix crash when destroying a RenderWidgetHost that holds the pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/frame_host/cross_process_frame_connector.h" 5 #include "content/browser/frame_host/cross_process_frame_connector.h"
6 6
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 root_view->Focus(); 196 root_view->Focus();
197 } 197 }
198 198
199 bool CrossProcessFrameConnector::LockMouse() { 199 bool CrossProcessFrameConnector::LockMouse() {
200 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); 200 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
201 if (root_view) 201 if (root_view)
202 return root_view->LockMouse(); 202 return root_view->LockMouse();
203 return false; 203 return false;
204 } 204 }
205 205
206 void CrossProcessFrameConnector::UnlockMouse() {
207 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
208 if (root_view)
209 root_view->UnlockMouse();
210 }
211
206 void CrossProcessFrameConnector::OnForwardInputEvent( 212 void CrossProcessFrameConnector::OnForwardInputEvent(
207 const blink::WebInputEvent* event) { 213 const blink::WebInputEvent* event) {
208 if (!view_) 214 if (!view_)
209 return; 215 return;
210 216
211 RenderFrameHostManager* manager = 217 RenderFrameHostManager* manager =
212 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager(); 218 frame_proxy_in_parent_renderer_->frame_tree_node()->render_manager();
213 RenderWidgetHostImpl* parent_widget = 219 RenderWidgetHostImpl* parent_widget =
214 manager->ForInnerDelegate() 220 manager->ForInnerDelegate()
215 ? manager->GetOuterRenderWidgetHostForKeyboardInput() 221 ? manager->GetOuterRenderWidgetHostForKeyboardInput()
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 346
341 if (parent) { 347 if (parent) {
342 return static_cast<RenderWidgetHostViewBase*>( 348 return static_cast<RenderWidgetHostViewBase*>(
343 parent->current_frame_host()->GetView()); 349 parent->current_frame_host()->GetView());
344 } 350 }
345 351
346 return nullptr; 352 return nullptr;
347 } 353 }
348 354
349 } // namespace content 355 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698