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/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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 geolocation_service_context_(new GeolocationServiceContext()), | 408 geolocation_service_context_(new GeolocationServiceContext()), |
| 409 accessibility_mode_( | 409 accessibility_mode_( |
| 410 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 410 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
| 411 audio_stream_monitor_(this), | 411 audio_stream_monitor_(this), |
| 412 virtual_keyboard_requested_(false), | 412 virtual_keyboard_requested_(false), |
| 413 page_scale_factor_is_one_(true), | 413 page_scale_factor_is_one_(true), |
| 414 loading_weak_factory_(this) { | 414 loading_weak_factory_(this) { |
| 415 frame_tree_.SetFrameRemoveListener( | 415 frame_tree_.SetFrameRemoveListener( |
| 416 base::Bind(&WebContentsImpl::OnFrameRemoved, | 416 base::Bind(&WebContentsImpl::OnFrameRemoved, |
| 417 base::Unretained(this))); | 417 base::Unretained(this))); |
| 418 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); | |
| 418 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 419 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
| 419 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); | 420 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
| 420 } | 421 } |
| 421 | 422 |
| 422 WebContentsImpl::~WebContentsImpl() { | 423 WebContentsImpl::~WebContentsImpl() { |
| 423 is_being_destroyed_ = true; | 424 is_being_destroyed_ = true; |
| 424 | 425 |
| 425 rwh_input_event_router_.reset(); | 426 rwh_input_event_router_.reset(); |
| 426 | 427 |
| 427 // Delete all RFH pending shutdown, which will lead the corresponding RVH to | 428 // Delete all RFH pending shutdown, which will lead the corresponding RVH to |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1828 !delegate_->ShouldCreateWebContents( | 1829 !delegate_->ShouldCreateWebContents( |
| 1829 this, route_id, main_frame_route_id, main_frame_widget_route_id, | 1830 this, route_id, main_frame_route_id, main_frame_widget_route_id, |
| 1830 params.window_container_type, params.frame_name, params.target_url, | 1831 params.window_container_type, params.frame_name, params.target_url, |
| 1831 partition_id, session_storage_namespace)) { | 1832 partition_id, session_storage_namespace)) { |
| 1832 if (route_id != MSG_ROUTING_NONE && | 1833 if (route_id != MSG_ROUTING_NONE && |
| 1833 !RenderViewHost::FromID(render_process_id, route_id)) { | 1834 !RenderViewHost::FromID(render_process_id, route_id)) { |
| 1834 // If the embedder didn't create a WebContents for this route, we need to | 1835 // If the embedder didn't create a WebContents for this route, we need to |
| 1835 // delete the RenderView that had already been created. | 1836 // delete the RenderView that had already been created. |
| 1836 Send(new ViewMsg_Close(route_id)); | 1837 Send(new ViewMsg_Close(route_id)); |
| 1837 } | 1838 } |
| 1838 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); | 1839 // It's safe to only target the frame because the view will not have a |
| 1840 // change to create more frames at this point. Additionally, the frame's | |
| 1841 // requests will only be blocked if it lives in the same process as the | |
| 1842 // source. | |
|
Randy Smith (Not in Mondays)
2016/01/20 23:23:19
The second sentence "feels" to me as if it's an im
Charlie Harrison
2016/01/21 18:52:55
Yeah, it's not strictly necessary so I removed it.
| |
| 1843 if (site_instance == source_site_instance) { | |
| 1844 ResourceDispatcherHostImpl::NotifyForRoute( | |
| 1845 GlobalFrameRoutingId(render_process_id, main_frame_route_id), | |
| 1846 base::Bind( | |
| 1847 &ResourceDispatcherHostImpl::ResumeBlockedRequestsForRoute)); | |
| 1848 } | |
| 1839 return; | 1849 return; |
| 1840 } | 1850 } |
| 1841 | 1851 |
| 1842 // Create the new web contents. This will automatically create the new | 1852 // Create the new web contents. This will automatically create the new |
| 1843 // WebContentsView. In the future, we may want to create the view separately. | 1853 // WebContentsView. In the future, we may want to create the view separately. |
| 1844 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1854 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
| 1845 create_params.routing_id = route_id; | 1855 create_params.routing_id = route_id; |
| 1846 create_params.main_frame_routing_id = main_frame_route_id; | 1856 create_params.main_frame_routing_id = main_frame_route_id; |
| 1847 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; | 1857 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; |
| 1848 create_params.main_frame_name = params.frame_name; | 1858 create_params.main_frame_name = params.frame_name; |
| (...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4739 const WebContentsObserver::MediaPlayerId& id) { | 4749 const WebContentsObserver::MediaPlayerId& id) { |
| 4740 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4750 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4741 } | 4751 } |
| 4742 | 4752 |
| 4743 void WebContentsImpl::MediaStoppedPlaying( | 4753 void WebContentsImpl::MediaStoppedPlaying( |
| 4744 const WebContentsObserver::MediaPlayerId& id) { | 4754 const WebContentsObserver::MediaPlayerId& id) { |
| 4745 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4755 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4746 } | 4756 } |
| 4747 | 4757 |
| 4748 } // namespace content | 4758 } // namespace content |
| OLD | NEW |