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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2426733004: Bug fix: Use the last hidden time for purge + suspend (Closed)
Patch Set: (rebase) Created 4 years, 2 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 | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8fafdaeb59cce21eb0bde46d2e6f87fbeb6b1e2d..fb769b94f04f73939108eb5a177b3b31765b8442 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1324,6 +1324,10 @@ void WebContentsImpl::SetLastActiveTime(base::TimeTicks last_active_time) {
last_active_time_ = last_active_time;
}
+base::TimeTicks WebContentsImpl::GetLastHiddenTime() const {
+ return last_hidden_time_;
+}
+
void WebContentsImpl::WasShown() {
controller_.SetActive(true);
@@ -1364,6 +1368,8 @@ void WebContentsImpl::WasHidden() {
SendPageMessage(new PageMsg_WasHidden(MSG_ROUTING_NONE));
}
+ last_hidden_time_ = base::TimeTicks::Now();
+
for (auto& observer : observers_)
observer.WasHidden();
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698