summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorgeorgesak <georgesak@chromium.org>2015-05-14 20:01:50 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-15 03:02:07 +0000
commit041ef9c96d9a5b6f206a24385b0e6e4b3dbf9f20 (patch)
tree8550fce8183df4b1132d3b6d4859f3dcdc32dba7 /components
parent4bae6ed4c1a8a249a83414b8f8e9fb00e6cc66bb (diff)
downloadchromium_src-041ef9c96d9a5b6f206a24385b0e6e4b3dbf9f20.zip
chromium_src-041ef9c96d9a5b6f206a24385b0e6e4b3dbf9f20.tar.gz
chromium_src-041ef9c96d9a5b6f206a24385b0e6e4b3dbf9f20.tar.bz2
Change WebContents::last_active_time_ to Time instead of Timeticks.
For context, last_active_time_ is going to be used by session restore to order the loading of background tabs using MRU. In order for this to be robust, last_active_time_ must be saved and restore between sessions. Timeticks cannot be reliably restored as it's dependent on the current OS session. MRU code for session restore is being implemented in https://codereview.chromium.org/1131373003 Notes: - In dev tools, replaced "activity" with "active" for consistency - In OomPriorityManagerTest.Comparator, initialized last_active_time for all tabs, as this is necessary with Time (a default TimeTicks can go back in time, not the case with Time). BUG=472772 Review URL: https://codereview.chromium.org/1140083004 Cr-Commit-Position: refs/heads/master@{#330029}
Diffstat (limited to 'components')
-rw-r--r--components/devtools_discovery/basic_target_descriptor.cc6
-rw-r--r--components/devtools_discovery/basic_target_descriptor.h4
-rw-r--r--components/devtools_discovery/devtools_target_descriptor.h2
-rw-r--r--components/devtools_http_handler/devtools_http_handler.cc2
4 files changed, 7 insertions, 7 deletions
diff --git a/components/devtools_discovery/basic_target_descriptor.cc b/components/devtools_discovery/basic_target_descriptor.cc
index d8d2f83..e425b8b 100644
--- a/components/devtools_discovery/basic_target_descriptor.cc
+++ b/components/devtools_discovery/basic_target_descriptor.cc
@@ -47,7 +47,7 @@ BasicTargetDescriptor::BasicTargetDescriptor(
content::NavigationEntry* entry = controller.GetActiveEntry();
if (entry != NULL && entry->GetURL().is_valid())
favicon_url_ = entry->GetFavicon().url;
- last_activity_time_ = web_contents->GetLastActiveTime();
+ last_active_time_ = web_contents->GetLastActiveTime();
}
}
@@ -82,8 +82,8 @@ GURL BasicTargetDescriptor::GetFaviconURL() const {
return favicon_url_;
}
-base::TimeTicks BasicTargetDescriptor::GetLastActivityTime() const {
- return last_activity_time_;
+base::Time BasicTargetDescriptor::GetLastActiveTime() const {
+ return last_active_time_;
}
bool BasicTargetDescriptor::IsAttached() const {
diff --git a/components/devtools_discovery/basic_target_descriptor.h b/components/devtools_discovery/basic_target_descriptor.h
index a3b834a..6161839 100644
--- a/components/devtools_discovery/basic_target_descriptor.h
+++ b/components/devtools_discovery/basic_target_descriptor.h
@@ -28,7 +28,7 @@ class BasicTargetDescriptor : public DevToolsTargetDescriptor {
std::string GetDescription() const override;
GURL GetURL() const override;
GURL GetFaviconURL() const override;
- base::TimeTicks GetLastActivityTime() const override;
+ base::Time GetLastActiveTime() const override;
bool IsAttached() const override;
scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const override;
bool Activate() const override;
@@ -50,7 +50,7 @@ class BasicTargetDescriptor : public DevToolsTargetDescriptor {
std::string description_;
GURL url_;
GURL favicon_url_;
- base::TimeTicks last_activity_time_;
+ base::Time last_active_time_;
};
} // namespace devtools_discovery
diff --git a/components/devtools_discovery/devtools_target_descriptor.h b/components/devtools_discovery/devtools_target_descriptor.h
index 9b3200d..995453e 100644
--- a/components/devtools_discovery/devtools_target_descriptor.h
+++ b/components/devtools_discovery/devtools_target_descriptor.h
@@ -50,7 +50,7 @@ class DevToolsTargetDescriptor {
virtual GURL GetFaviconURL() const = 0;
// Returns the time when the target was last active.
- virtual base::TimeTicks GetLastActivityTime() const = 0;
+ virtual base::Time GetLastActiveTime() const = 0;
// Returns true if the debugger is attached to the target.
virtual bool IsAttached() const = 0;
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc
index 2a72d06..3c9a8e7 100644
--- a/components/devtools_http_handler/devtools_http_handler.cc
+++ b/components/devtools_http_handler/devtools_http_handler.cc
@@ -320,7 +320,7 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient {
static bool TimeComparator(const DevToolsTargetDescriptor* desc1,
const DevToolsTargetDescriptor* desc2) {
- return desc1->GetLastActivityTime() > desc2->GetLastActivityTime();
+ return desc1->GetLastActiveTime() > desc2->GetLastActiveTime();
}
// DevToolsHttpHandler::ServerSocketFactory ----------------------------------