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 <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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 geolocation_service_context_(new GeolocationServiceContext()), | 402 geolocation_service_context_(new GeolocationServiceContext()), |
| 403 accessibility_mode_( | 403 accessibility_mode_( |
| 404 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 404 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
| 405 audio_stream_monitor_(this), | 405 audio_stream_monitor_(this), |
| 406 virtual_keyboard_requested_(false), | 406 virtual_keyboard_requested_(false), |
| 407 page_scale_factor_is_one_(true), | 407 page_scale_factor_is_one_(true), |
| 408 loading_weak_factory_(this) { | 408 loading_weak_factory_(this) { |
| 409 frame_tree_.SetFrameRemoveListener( | 409 frame_tree_.SetFrameRemoveListener( |
| 410 base::Bind(&WebContentsImpl::OnFrameRemoved, | 410 base::Bind(&WebContentsImpl::OnFrameRemoved, |
| 411 base::Unretained(this))); | 411 base::Unretained(this))); |
| 412 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifer(this)); | |
|
Randy Smith (Not in Mondays)
2015/12/29 23:11:37
I'm confused; naively, it looks like you're never
Charlie Harrison
2015/12/30 20:51:49
The only way this gets used is as a WebContentsObs
Randy Smith (Not in Mondays)
2016/01/04 21:24:48
Right, whoops, sorry I missed that. I'm good with
| |
| 412 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 413 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
| 413 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); | 414 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
| 414 } | 415 } |
| 415 | 416 |
| 416 WebContentsImpl::~WebContentsImpl() { | 417 WebContentsImpl::~WebContentsImpl() { |
| 417 is_being_destroyed_ = true; | 418 is_being_destroyed_ = true; |
| 418 | 419 |
| 419 rwh_input_event_router_.reset(); | 420 rwh_input_event_router_.reset(); |
| 420 | 421 |
| 421 // Delete all RFH pending shutdown, which will lead the corresponding RVH to | 422 // Delete all RFH pending shutdown, which will lead the corresponding RVH to |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1805 !delegate_->ShouldCreateWebContents( | 1806 !delegate_->ShouldCreateWebContents( |
| 1806 this, route_id, main_frame_route_id, main_frame_widget_route_id, | 1807 this, route_id, main_frame_route_id, main_frame_widget_route_id, |
| 1807 params.window_container_type, params.frame_name, params.target_url, | 1808 params.window_container_type, params.frame_name, params.target_url, |
| 1808 partition_id, session_storage_namespace)) { | 1809 partition_id, session_storage_namespace)) { |
| 1809 if (route_id != MSG_ROUTING_NONE && | 1810 if (route_id != MSG_ROUTING_NONE && |
| 1810 !RenderViewHost::FromID(render_process_id, route_id)) { | 1811 !RenderViewHost::FromID(render_process_id, route_id)) { |
| 1811 // If the embedder didn't create a WebContents for this route, we need to | 1812 // If the embedder didn't create a WebContents for this route, we need to |
| 1812 // delete the RenderView that had already been created. | 1813 // delete the RenderView that had already been created. |
| 1813 Send(new ViewMsg_Close(route_id)); | 1814 Send(new ViewMsg_Close(route_id)); |
| 1814 } | 1815 } |
| 1815 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); | 1816 GetRenderViewHost()->GetProcess()->ResumeRequestsForFrame( |
| 1817 main_frame_route_id); | |
| 1816 return; | 1818 return; |
| 1817 } | 1819 } |
| 1818 | 1820 |
| 1819 // Create the new web contents. This will automatically create the new | 1821 // Create the new web contents. This will automatically create the new |
| 1820 // WebContentsView. In the future, we may want to create the view separately. | 1822 // WebContentsView. In the future, we may want to create the view separately. |
| 1821 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1823 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
| 1822 create_params.routing_id = route_id; | 1824 create_params.routing_id = route_id; |
| 1823 create_params.main_frame_routing_id = main_frame_route_id; | 1825 create_params.main_frame_routing_id = main_frame_route_id; |
| 1824 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; | 1826 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; |
| 1825 create_params.main_frame_name = params.frame_name; | 1827 create_params.main_frame_name = params.frame_name; |
| (...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4715 const WebContentsObserver::MediaPlayerId& id) { | 4717 const WebContentsObserver::MediaPlayerId& id) { |
| 4716 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4718 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4717 } | 4719 } |
| 4718 | 4720 |
| 4719 void WebContentsImpl::MediaStoppedPlaying( | 4721 void WebContentsImpl::MediaStoppedPlaying( |
| 4720 const WebContentsObserver::MediaPlayerId& id) { | 4722 const WebContentsObserver::MediaPlayerId& id) { |
| 4721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4723 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4722 } | 4724 } |
| 4723 | 4725 |
| 4724 } // namespace content | 4726 } // namespace content |
| OLD | NEW |