Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2731283003: (Reland) Discard compositor frames from unloaded web content (Closed)
Patch Set: Initialize field to zero Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 // For a top-level frame, there are potential security concerns associated 1298 // For a top-level frame, there are potential security concerns associated
1299 // with displaying graphics from a previously loaded page after the URL in 1299 // with displaying graphics from a previously loaded page after the URL in
1300 // the omnibar has been changed. It is unappealing to clear the page 1300 // the omnibar has been changed. It is unappealing to clear the page
1301 // immediately, but if the renderer is taking a long time to issue any 1301 // immediately, but if the renderer is taking a long time to issue any
1302 // compositor output (possibly because of script deliberately creating this 1302 // compositor output (possibly because of script deliberately creating this
1303 // situation) then we clear it after a while anyway. 1303 // situation) then we clear it after a while anyway.
1304 // See https://crbug.com/497588. 1304 // See https://crbug.com/497588.
1305 if (frame_tree_node_->IsMainFrame() && GetView() && 1305 if (frame_tree_node_->IsMainFrame() && GetView() &&
1306 !validated_params.was_within_same_page) { 1306 !validated_params.was_within_same_page) {
1307 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) 1307 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())
1308 ->StartNewContentRenderingTimeout(); 1308 ->StartNewContentRenderingTimeout(validated_params.content_source_id);
1309 } 1309 }
1310 } 1310 }
1311 1311
1312 void RenderFrameHostImpl::OnUpdateState(const PageState& state) { 1312 void RenderFrameHostImpl::OnUpdateState(const PageState& state) {
1313 // TODO(creis): Verify the state's ISN matches the last committed FNE. 1313 // TODO(creis): Verify the state's ISN matches the last committed FNE.
1314 1314
1315 // Without this check, the renderer can trick the browser into using 1315 // Without this check, the renderer can trick the browser into using
1316 // filenames it can't access in a future session restore. 1316 // filenames it can't access in a future session restore.
1317 if (!CanAccessFilesOfPageState(state)) { 1317 if (!CanAccessFilesOfPageState(state)) {
1318 bad_message::ReceivedBadMessage( 1318 bad_message::ReceivedBadMessage(
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after
3458 // There is no pending NavigationEntry in these cases, so pass 0 as the 3458 // There is no pending NavigationEntry in these cases, so pass 0 as the
3459 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3459 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3460 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3460 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3461 return NavigationHandleImpl::Create( 3461 return NavigationHandleImpl::Create(
3462 params.url, params.redirects, frame_tree_node_, is_renderer_initiated, 3462 params.url, params.redirects, frame_tree_node_, is_renderer_initiated,
3463 params.was_within_same_page, base::TimeTicks::Now(), 3463 params.was_within_same_page, base::TimeTicks::Now(),
3464 entry_id_for_data_nav, false); // started_from_context_menu 3464 entry_id_for_data_nav, false); // started_from_context_menu
3465 } 3465 }
3466 3466
3467 } // namespace content 3467 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698