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

Unified Diff: components/sync_driver/revisit/current_tab_matcher.cc

Issue 1387253004: [Sync] Creating sync_sessions component, moving revisit logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing test_support target. Created 5 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
Index: components/sync_driver/revisit/current_tab_matcher.cc
diff --git a/components/sync_driver/revisit/current_tab_matcher.cc b/components/sync_driver/revisit/current_tab_matcher.cc
deleted file mode 100644
index 13e63f99c56026c843eb211e5a16f34da7bf3c82..0000000000000000000000000000000000000000
--- a/components/sync_driver/revisit/current_tab_matcher.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/sync_driver/revisit/current_tab_matcher.h"
-
-#include "base/metrics/histogram_macros.h"
-#include "base/time/time.h"
-#include "components/sessions/core/serialized_navigation_entry.h"
-
-namespace sync_driver {
-
-CurrentTabMatcher::CurrentTabMatcher(const PageEquality& page_equality)
- : page_equality_(page_equality) {}
-
-void CurrentTabMatcher::Check(const sessions::SessionTab* tab) {
- if (tab->navigations.empty()) {
- return;
- }
- const sessions::SerializedNavigationEntry& currentEntry =
- tab->navigations[tab->normalized_navigation_index()];
- // Cannot rely on SerializedNavigationEntry timestamps, they're
- // not set for foreign sessions. Instead rely on tab timestamps.
- if (page_equality_.IsSamePage(currentEntry.virtual_url()) &&
- (most_recent_match_ == nullptr ||
- tab->timestamp > most_recent_match_->timestamp)) {
- most_recent_match_ = tab;
- }
-}
-
-void CurrentTabMatcher::Emit(
- const PageVisitObserver::TransitionType transition) {
- if (most_recent_match_ == nullptr) {
- UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTabMissTransition", transition,
- PageVisitObserver::kTransitionTypeLast);
- } else {
- base::TimeDelta age(base::Time::Now() - most_recent_match_->timestamp);
- UMA_HISTOGRAM_CUSTOM_TIMES("Sync.PageRevisitTabMatchAge", age,
- base::TimeDelta::FromSeconds(1),
- base::TimeDelta::FromDays(14), 100);
- UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTabMatchTransition", transition,
- PageVisitObserver::kTransitionTypeLast);
- }
-}
-
-} // namespace sync_driver
« no previous file with comments | « components/sync_driver/revisit/current_tab_matcher.h ('k') | components/sync_driver/revisit/current_tab_matcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698