OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 CHECK(proxy); | 578 CHECK(proxy); |
579 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id); | 579 render_frame = RenderFrameImpl::Create(proxy->render_view(), routing_id); |
580 web_frame = | 580 web_frame = |
581 blink::WebLocalFrame::create(replicated_state.scope, render_frame); | 581 blink::WebLocalFrame::create(replicated_state.scope, render_frame); |
582 render_frame->proxy_routing_id_ = proxy_routing_id; | 582 render_frame->proxy_routing_id_ = proxy_routing_id; |
583 web_frame->initializeToReplaceRemoteFrame( | 583 web_frame->initializeToReplaceRemoteFrame( |
584 proxy->web_frame(), WebString::fromUTF8(replicated_state.name), | 584 proxy->web_frame(), WebString::fromUTF8(replicated_state.name), |
585 replicated_state.sandbox_flags); | 585 replicated_state.sandbox_flags); |
586 } | 586 } |
587 render_frame->SetWebFrame(web_frame); | 587 render_frame->SetWebFrame(web_frame); |
588 CHECK_IMPLIES(parent_routing_id == MSG_ROUTING_NONE, !web_frame->parent()); | 588 CHECK(parent_routing_id != MSG_ROUTING_NONE || !web_frame->parent()); |
589 | 589 |
590 if (widget_params.routing_id != MSG_ROUTING_NONE) { | 590 if (widget_params.routing_id != MSG_ROUTING_NONE) { |
591 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 591 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
592 switches::kSitePerProcess)); | 592 switches::kSitePerProcess)); |
593 render_frame->render_widget_ = RenderWidget::CreateForFrame( | 593 render_frame->render_widget_ = RenderWidget::CreateForFrame( |
594 widget_params.routing_id, widget_params.surface_id, | 594 widget_params.routing_id, widget_params.surface_id, |
595 widget_params.hidden, render_frame->render_view_->screen_info(), | 595 widget_params.hidden, render_frame->render_view_->screen_info(), |
596 compositor_deps, web_frame); | 596 compositor_deps, web_frame); |
597 // TODO(kenrb): Observing shouldn't be necessary when we sort out | 597 // TODO(kenrb): Observing shouldn't be necessary when we sort out |
598 // WasShown and WasHidden, separating page-level visibility from | 598 // WasShown and WasHidden, separating page-level visibility from |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 int proxy_routing_id, | 1119 int proxy_routing_id, |
1120 bool is_loading, | 1120 bool is_loading, |
1121 const FrameReplicationState& replicated_frame_state) { | 1121 const FrameReplicationState& replicated_frame_state) { |
1122 TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_); | 1122 TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_); |
1123 RenderFrameProxy* proxy = NULL; | 1123 RenderFrameProxy* proxy = NULL; |
1124 bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( | 1124 bool is_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( |
1125 switches::kSitePerProcess); | 1125 switches::kSitePerProcess); |
1126 bool is_main_frame = !frame_->parent(); | 1126 bool is_main_frame = !frame_->parent(); |
1127 | 1127 |
1128 // This codepath should only be hit for subframes when in --site-per-process. | 1128 // This codepath should only be hit for subframes when in --site-per-process. |
1129 CHECK_IMPLIES(!is_main_frame, is_site_per_process); | 1129 CHECK(is_main_frame || is_site_per_process); |
1130 | 1130 |
1131 // Only run unload if we're not swapped out yet, but send the ack either way. | 1131 // Only run unload if we're not swapped out yet, but send the ack either way. |
1132 if (!is_swapped_out_) { | 1132 if (!is_swapped_out_) { |
1133 // Swap this RenderFrame out so the frame can navigate to a page rendered by | 1133 // Swap this RenderFrame out so the frame can navigate to a page rendered by |
1134 // a different process. This involves running the unload handler and | 1134 // a different process. This involves running the unload handler and |
1135 // clearing the page. We also allow this process to exit if there are no | 1135 // clearing the page. We also allow this process to exit if there are no |
1136 // other active RenderFrames in it. | 1136 // other active RenderFrames in it. |
1137 | 1137 |
1138 // Send an UpdateState message before we get swapped out. | 1138 // Send an UpdateState message before we get swapped out. |
1139 render_view_->SyncNavigationState(); | 1139 render_view_->SyncNavigationState(); |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 if (is_new_navigation) { | 2654 if (is_new_navigation) { |
2655 // We bump our Page ID to correspond with the new session history entry. | 2655 // We bump our Page ID to correspond with the new session history entry. |
2656 render_view_->page_id_ = render_view_->next_page_id_++; | 2656 render_view_->page_id_ = render_view_->next_page_id_++; |
2657 | 2657 |
2658 // Don't update history list values for kSwappedOutURL, since | 2658 // Don't update history list values for kSwappedOutURL, since |
2659 // we don't want to forget the entry that was there, and since we will | 2659 // we don't want to forget the entry that was there, and since we will |
2660 // never come back to kSwappedOutURL. Note that we have to call | 2660 // never come back to kSwappedOutURL. Note that we have to call |
2661 // UpdateSessionHistory and update page_id_ even in this case, so that | 2661 // UpdateSessionHistory and update page_id_ even in this case, so that |
2662 // the current entry gets a state update and so that we don't send a | 2662 // the current entry gets a state update and so that we don't send a |
2663 // state update to the wrong entry when we swap back in. | 2663 // state update to the wrong entry when we swap back in. |
2664 DCHECK_IMPLIES( | 2664 DCHECK(!navigation_state->start_params().should_replace_current_entry || |
2665 navigation_state->start_params().should_replace_current_entry, | 2665 render_view_->history_list_length_ > 0); |
2666 render_view_->history_list_length_ > 0); | |
2667 if (GetLoadingUrl() != GURL(kSwappedOutURL) && | 2666 if (GetLoadingUrl() != GURL(kSwappedOutURL) && |
2668 !navigation_state->start_params().should_replace_current_entry) { | 2667 !navigation_state->start_params().should_replace_current_entry) { |
2669 // Advance our offset in session history, applying the length limit. | 2668 // Advance our offset in session history, applying the length limit. |
2670 // There is now no forward history. | 2669 // There is now no forward history. |
2671 render_view_->history_list_offset_++; | 2670 render_view_->history_list_offset_++; |
2672 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) | 2671 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) |
2673 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; | 2672 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; |
2674 render_view_->history_list_length_ = | 2673 render_view_->history_list_length_ = |
2675 render_view_->history_list_offset_ + 1; | 2674 render_view_->history_list_offset_ + 1; |
2676 } | 2675 } |
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5002 cdm_manager_ | 5001 cdm_manager_ |
5003 #endif | 5002 #endif |
5004 )); | 5003 )); |
5005 #endif // defined(ENABLE_MOJO_MEDIA) | 5004 #endif // defined(ENABLE_MOJO_MEDIA) |
5006 } | 5005 } |
5007 | 5006 |
5008 return cdm_factory_.get(); | 5007 return cdm_factory_.get(); |
5009 } | 5008 } |
5010 | 5009 |
5011 } // namespace content | 5010 } // namespace content |
OLD | NEW |