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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 geolocation_service_context_(new GeolocationServiceContext()), | 406 geolocation_service_context_(new GeolocationServiceContext()), |
407 accessibility_mode_( | 407 accessibility_mode_( |
408 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 408 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
409 audio_stream_monitor_(this), | 409 audio_stream_monitor_(this), |
410 virtual_keyboard_requested_(false), | 410 virtual_keyboard_requested_(false), |
411 page_scale_factor_is_one_(true), | 411 page_scale_factor_is_one_(true), |
412 loading_weak_factory_(this) { | 412 loading_weak_factory_(this) { |
413 frame_tree_.SetFrameRemoveListener( | 413 frame_tree_.SetFrameRemoveListener( |
414 base::Bind(&WebContentsImpl::OnFrameRemoved, | 414 base::Bind(&WebContentsImpl::OnFrameRemoved, |
415 base::Unretained(this))); | 415 base::Unretained(this))); |
416 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifierImpl(this)); | |
416 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 417 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
417 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); | 418 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
418 } | 419 } |
419 | 420 |
420 WebContentsImpl::~WebContentsImpl() { | 421 WebContentsImpl::~WebContentsImpl() { |
421 is_being_destroyed_ = true; | 422 is_being_destroyed_ = true; |
422 | 423 |
423 rwh_input_event_router_.reset(); | 424 rwh_input_event_router_.reset(); |
424 | 425 |
425 // Delete all RFH pending shutdown, which will lead the corresponding RVH to | 426 // Delete all RFH pending shutdown, which will lead the corresponding RVH to |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1810 !delegate_->ShouldCreateWebContents( | 1811 !delegate_->ShouldCreateWebContents( |
1811 this, route_id, main_frame_route_id, main_frame_widget_route_id, | 1812 this, route_id, main_frame_route_id, main_frame_widget_route_id, |
1812 params.window_container_type, params.frame_name, params.target_url, | 1813 params.window_container_type, params.frame_name, params.target_url, |
1813 partition_id, session_storage_namespace)) { | 1814 partition_id, session_storage_namespace)) { |
1814 if (route_id != MSG_ROUTING_NONE && | 1815 if (route_id != MSG_ROUTING_NONE && |
1815 !RenderViewHost::FromID(render_process_id, route_id)) { | 1816 !RenderViewHost::FromID(render_process_id, route_id)) { |
1816 // If the embedder didn't create a WebContents for this route, we need to | 1817 // If the embedder didn't create a WebContents for this route, we need to |
1817 // delete the RenderView that had already been created. | 1818 // delete the RenderView that had already been created. |
1818 Send(new ViewMsg_Close(route_id)); | 1819 Send(new ViewMsg_Close(route_id)); |
1819 } | 1820 } |
1820 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); | 1821 LoaderIOThreadNotifierImpl::ResumeBlockedRequestsForFrameInternal( |
Randy Smith (Not in Mondays)
2016/01/06 21:56:30
I presume that it's safe to just target the frame
Randy Smith (Not in Mondays)
2016/01/06 21:56:30
Help me understand the context in which this code
Charlie Harrison
2016/01/07 22:47:06
It's rather confusing :/ but I believe what is hap
Charlie Harrison
2016/01/07 22:47:06
Done.
| |
1822 GlobalFrameRoutingId(GetRenderViewHost()->GetProcess()->GetID(), | |
nasko
2016/01/07 00:43:09
Why are you getting the process id from the Render
Charlie Harrison
2016/01/07 22:47:06
Good catch. Actually, I think we should be grabbin
| |
1823 main_frame_route_id)); | |
1821 return; | 1824 return; |
1822 } | 1825 } |
1823 | 1826 |
1824 // Create the new web contents. This will automatically create the new | 1827 // Create the new web contents. This will automatically create the new |
1825 // WebContentsView. In the future, we may want to create the view separately. | 1828 // WebContentsView. In the future, we may want to create the view separately. |
1826 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1829 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
1827 create_params.routing_id = route_id; | 1830 create_params.routing_id = route_id; |
1828 create_params.main_frame_routing_id = main_frame_route_id; | 1831 create_params.main_frame_routing_id = main_frame_route_id; |
1829 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; | 1832 create_params.main_frame_widget_routing_id = main_frame_widget_route_id; |
1830 create_params.main_frame_name = params.frame_name; | 1833 create_params.main_frame_name = params.frame_name; |
(...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4721 const WebContentsObserver::MediaPlayerId& id) { | 4724 const WebContentsObserver::MediaPlayerId& id) { |
4722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4725 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4723 } | 4726 } |
4724 | 4727 |
4725 void WebContentsImpl::MediaStoppedPlaying( | 4728 void WebContentsImpl::MediaStoppedPlaying( |
4726 const WebContentsObserver::MediaPlayerId& id) { | 4729 const WebContentsObserver::MediaPlayerId& id) { |
4727 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4730 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4728 } | 4731 } |
4729 | 4732 |
4730 } // namespace content | 4733 } // namespace content |
OLD | NEW |