OLD | NEW |
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_hittest.h" | 8 #include "cc/surfaces/surface_hittest.h" |
9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
10 #include "content/browser/compositor/surface_utils.h" | 10 #include "content/browser/compositor/surface_utils.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 IPC_MESSAGE_UNHANDLED(handled = false) | 48 IPC_MESSAGE_UNHANDLED(handled = false) |
49 IPC_END_MESSAGE_MAP() | 49 IPC_END_MESSAGE_MAP() |
50 | 50 |
51 return handled; | 51 return handled; |
52 } | 52 } |
53 | 53 |
54 void CrossProcessFrameConnector::set_view( | 54 void CrossProcessFrameConnector::set_view( |
55 RenderWidgetHostViewChildFrame* view) { | 55 RenderWidgetHostViewChildFrame* view) { |
56 // Detach ourselves from the previous |view_|. | 56 // Detach ourselves from the previous |view_|. |
57 if (view_) { | 57 if (view_) { |
58 if (is_scroll_bubbling_ && GetParentRenderWidgetHostView()) { | 58 // The RenderWidgetHostDelegate needs to be checked because set_view() can |
| 59 // be called during nested WebContents destruction. See |
| 60 // https://crbug.com/644306. |
| 61 if (is_scroll_bubbling_ && GetParentRenderWidgetHostView() && |
| 62 RenderWidgetHostImpl::From( |
| 63 GetParentRenderWidgetHostView()->GetRenderWidgetHost()) |
| 64 ->delegate()) { |
59 RenderWidgetHostImpl::From( | 65 RenderWidgetHostImpl::From( |
60 GetParentRenderWidgetHostView()->GetRenderWidgetHost()) | 66 GetParentRenderWidgetHostView()->GetRenderWidgetHost()) |
61 ->delegate() | 67 ->delegate() |
62 ->GetInputEventRouter() | 68 ->GetInputEventRouter() |
63 ->CancelScrollBubbling(view_); | 69 ->CancelScrollBubbling(view_); |
64 is_scroll_bubbling_ = false; | 70 is_scroll_bubbling_ = false; |
65 } | 71 } |
66 view_->SetCrossProcessFrameConnector(nullptr); | 72 view_->SetCrossProcessFrameConnector(nullptr); |
67 } | 73 } |
68 | 74 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 369 |
364 if (parent) { | 370 if (parent) { |
365 return static_cast<RenderWidgetHostViewBase*>( | 371 return static_cast<RenderWidgetHostViewBase*>( |
366 parent->current_frame_host()->GetView()); | 372 parent->current_frame_host()->GetView()); |
367 } | 373 } |
368 | 374 |
369 return nullptr; | 375 return nullptr; |
370 } | 376 } |
371 | 377 |
372 } // namespace content | 378 } // namespace content |
OLD | NEW |