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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 page_scale_factor_is_one_(true), | 396 page_scale_factor_is_one_(true), |
397 loading_weak_factory_(this) { | 397 loading_weak_factory_(this) { |
398 frame_tree_.SetFrameRemoveListener( | 398 frame_tree_.SetFrameRemoveListener( |
399 base::Bind(&WebContentsImpl::OnFrameRemoved, | 399 base::Bind(&WebContentsImpl::OnFrameRemoved, |
400 base::Unretained(this))); | 400 base::Unretained(this))); |
401 #if defined(OS_ANDROID) | 401 #if defined(OS_ANDROID) |
402 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); | 402 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); |
403 #else | 403 #else |
404 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 404 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
405 #endif | 405 #endif |
406 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); | |
406 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); | 407 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
407 } | 408 } |
408 | 409 |
409 WebContentsImpl::~WebContentsImpl() { | 410 WebContentsImpl::~WebContentsImpl() { |
410 is_being_destroyed_ = true; | 411 is_being_destroyed_ = true; |
411 | 412 |
412 rwh_input_event_router_.reset(); | 413 rwh_input_event_router_.reset(); |
413 | 414 |
414 for (FrameTreeNode* node : frame_tree_.Nodes()) { | 415 for (FrameTreeNode* node : frame_tree_.Nodes()) { |
415 // Delete all RFHs pending shutdown, which will lead the corresponding RVHs | 416 // Delete all RFHs pending shutdown, which will lead the corresponding RVHs |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1841 !delegate_->ShouldCreateWebContents( | 1842 !delegate_->ShouldCreateWebContents( |
1842 this, route_id, main_frame_route_id, main_frame_widget_route_id, | 1843 this, route_id, main_frame_route_id, main_frame_widget_route_id, |
1843 params.window_container_type, params.frame_name, params.target_url, | 1844 params.window_container_type, params.frame_name, params.target_url, |
1844 partition_id, session_storage_namespace)) { | 1845 partition_id, session_storage_namespace)) { |
1845 if (route_id != MSG_ROUTING_NONE && | 1846 if (route_id != MSG_ROUTING_NONE && |
1846 !RenderViewHost::FromID(render_process_id, route_id)) { | 1847 !RenderViewHost::FromID(render_process_id, route_id)) { |
1847 // If the embedder didn't create a WebContents for this route, we need to | 1848 // If the embedder didn't create a WebContents for this route, we need to |
1848 // delete the RenderView that had already been created. | 1849 // delete the RenderView that had already been created. |
1849 Send(new ViewMsg_Close(route_id)); | 1850 Send(new ViewMsg_Close(route_id)); |
1850 } | 1851 } |
1851 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); | 1852 // It's safe to only target the frame because the render process will not |
1853 // have a chance to create more frames at this point. | |
Randy Smith (Not in Mondays)
2016/02/02 20:47:06
Is this comment still accurate, given that we're r
Charlie Harrison
2016/02/02 20:51:59
This code path (and the path that blocks it) still
| |
1854 ResourceDispatcherHostImpl::ResumeBlockedRequestsForRouteFromUI( | |
1855 GlobalFrameRoutingId(render_process_id, main_frame_route_id)); | |
1852 return; | 1856 return; |
1853 } | 1857 } |
1854 | 1858 |
1855 // Create the new web contents. This will automatically create the new | 1859 // Create the new web contents. This will automatically create the new |
1856 // WebContentsView. In the future, we may want to create the view separately. | 1860 // WebContentsView. In the future, we may want to create the view separately. |
1857 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1861 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
1858 create_params.routing_id = route_id; | 1862 create_params.routing_id = route_id; |
1859 create_params.main_frame_routing_id = main_frame_route_id; | 1863 create_params.main_frame_routing_id = main_frame_route_id; |
1860 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; | 1864 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; |
1861 create_params.main_frame_name = params.frame_name; | 1865 create_params.main_frame_name = params.frame_name; |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4751 const WebContentsObserver::MediaPlayerId& id) { | 4755 const WebContentsObserver::MediaPlayerId& id) { |
4752 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4756 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4753 } | 4757 } |
4754 | 4758 |
4755 void WebContentsImpl::MediaStoppedPlaying( | 4759 void WebContentsImpl::MediaStoppedPlaying( |
4756 const WebContentsObserver::MediaPlayerId& id) { | 4760 const WebContentsObserver::MediaPlayerId& id) { |
4757 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4761 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4758 } | 4762 } |
4759 | 4763 |
4760 } // namespace content | 4764 } // namespace content |
OLD | NEW |