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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1490 } | 1490 } |
1491 | 1491 |
1492 void WebContentsImpl::LostCapture(RenderWidgetHostImpl* render_widget_host) { | 1492 void WebContentsImpl::LostCapture(RenderWidgetHostImpl* render_widget_host) { |
1493 if (!RenderViewHostImpl::From(render_widget_host)) | 1493 if (!RenderViewHostImpl::From(render_widget_host)) |
1494 return; | 1494 return; |
1495 | 1495 |
1496 if (delegate_) | 1496 if (delegate_) |
1497 delegate_->LostCapture(); | 1497 delegate_->LostCapture(); |
1498 } | 1498 } |
1499 | 1499 |
1500 void WebContentsImpl::RenderWidgetCreated( | |
1501 RenderWidgetHostImpl* render_widget_host) { | |
1502 created_widgets_.insert(render_widget_host); | |
1503 } | |
1504 | |
1500 void WebContentsImpl::RenderWidgetDeleted( | 1505 void WebContentsImpl::RenderWidgetDeleted( |
1501 RenderWidgetHostImpl* render_widget_host) { | 1506 RenderWidgetHostImpl* render_widget_host) { |
1502 if (is_being_destroyed_) { | 1507 created_widgets_.erase(render_widget_host); |
Charlie Reis
2015/11/21 01:19:19
How are you getting here after is_being_destroyed_
lazyboy
2015/11/21 02:22:59
Yes.
FrameTree::ForEach in ~WebContentsImpl() call
| |
1503 // |created_widgets_| might have been destroyed. | 1508 |
1509 if (is_being_destroyed_) | |
1504 return; | 1510 return; |
1505 } | |
1506 | |
1507 std::set<RenderWidgetHostImpl*>::iterator iter = | |
1508 created_widgets_.find(render_widget_host); | |
1509 if (iter != created_widgets_.end()) | |
1510 created_widgets_.erase(iter); | |
1511 | 1511 |
1512 if (render_widget_host && | 1512 if (render_widget_host && |
1513 render_widget_host->GetRoutingID() == fullscreen_widget_routing_id_) { | 1513 render_widget_host->GetRoutingID() == fullscreen_widget_routing_id_) { |
1514 if (delegate_ && delegate_->EmbedsFullscreenWidget()) | 1514 if (delegate_ && delegate_->EmbedsFullscreenWidget()) |
1515 delegate_->ExitFullscreenModeForTab(this); | 1515 delegate_->ExitFullscreenModeForTab(this); |
1516 FOR_EACH_OBSERVER(WebContentsObserver, | 1516 FOR_EACH_OBSERVER(WebContentsObserver, |
1517 observers_, | 1517 observers_, |
1518 DidDestroyFullscreenWidget( | 1518 DidDestroyFullscreenWidget( |
1519 fullscreen_widget_routing_id_)); | 1519 fullscreen_widget_routing_id_)); |
1520 fullscreen_widget_routing_id_ = MSG_ROUTING_NONE; | 1520 fullscreen_widget_routing_id_ = MSG_ROUTING_NONE; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1910 if (process_handle != base::kNullProcessHandle) { | 1910 if (process_handle != base::kNullProcessHandle) { |
1911 RecordAction( | 1911 RecordAction( |
1912 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); | 1912 base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); |
1913 rph->Shutdown(RESULT_CODE_KILLED, false); | 1913 rph->Shutdown(RESULT_CODE_KILLED, false); |
1914 } | 1914 } |
1915 return; | 1915 return; |
1916 } | 1916 } |
1917 | 1917 |
1918 RenderWidgetHostImpl* widget_host = | 1918 RenderWidgetHostImpl* widget_host = |
1919 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); | 1919 new RenderWidgetHostImpl(this, process, route_id, IsHidden()); |
1920 created_widgets_.insert(widget_host); | |
1921 | 1920 |
1922 RenderWidgetHostViewBase* widget_view = | 1921 RenderWidgetHostViewBase* widget_view = |
1923 static_cast<RenderWidgetHostViewBase*>( | 1922 static_cast<RenderWidgetHostViewBase*>( |
1924 view_->CreateViewForPopupWidget(widget_host)); | 1923 view_->CreateViewForPopupWidget(widget_host)); |
1925 if (!widget_view) | 1924 if (!widget_view) |
1926 return; | 1925 return; |
1927 if (!is_fullscreen) { | 1926 if (!is_fullscreen) { |
1928 // Popups should not get activated. | 1927 // Popups should not get activated. |
1929 widget_view->SetPopupType(popup_type); | 1928 widget_view->SetPopupType(popup_type); |
1930 } | 1929 } |
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4783 return NULL; | 4782 return NULL; |
4784 } | 4783 } |
4785 | 4784 |
4786 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4785 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4787 force_disable_overscroll_content_ = force_disable; | 4786 force_disable_overscroll_content_ = force_disable; |
4788 if (view_) | 4787 if (view_) |
4789 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4788 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4790 } | 4789 } |
4791 | 4790 |
4792 } // namespace content | 4791 } // namespace content |
OLD | NEW |