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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 417343003: Don't capture screenshots for in-page navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 6aca3d54347570876a7d072b6c1a53e381ab1740..82ea518e11d446796191294d697c9e97147edd53 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -441,22 +441,11 @@ void NavigatorImpl::DidNavigate(
// change WebContents::GetRenderViewHost to return the new host, instead
// of the one that may have just been swapped out.
if (delegate_->CanOverscrollContent()) {
- bool page_id_changed;
- bool url_changed;
- NavigationEntry* current_entry = controller_->GetLastCommittedEntry();
- if (current_entry) {
- page_id_changed = params.page_id > 0 &&
- params.page_id != current_entry->GetPageID();
- url_changed = params.url != current_entry->GetURL();
- } else {
- page_id_changed = params.page_id > 0;
- url_changed = params.url != GURL::EmptyGURL();
- }
-
- // We only want to take the screenshot if the are navigating to a
- // different history entry than the current one. So if neither the
- // page id nor the url changed - don't take the screenshot.
- if (page_id_changed || url_changed)
+ // Don't take screenshots if we are staying on the same page. We want
+ // in-page navigations to be super fast, and taking a screenshot
+ // currently blocks GPU for a longer time than we are willing to
+ // tolerate in this use case.
+ if (!params.was_within_same_page)
controller_->TakeScreenshot();
}
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698