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

Unified Diff: components/sync_sessions/sessions_sync_manager.h

Issue 2494533002: [Sync] Put session tracker in charge of maintaining local state. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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_sessions/sessions_sync_manager.h
diff --git a/components/sync_sessions/sessions_sync_manager.h b/components/sync_sessions/sessions_sync_manager.h
index b81eac55d07c82c9910eb91cfd1f3251e39c4be8..a74416d76508449172724e82cad190df07b637e7 100644
--- a/components/sync_sessions/sessions_sync_manager.h
+++ b/components/sync_sessions/sessions_sync_manager.h
@@ -124,23 +124,17 @@ class SessionsSyncManager : public syncer::SyncableService,
// all other fields are.
class TabLink {
public:
- TabLink(int tab_node_id, const SyncedTabDelegate* tab)
- : tab_node_id_(tab_node_id), tab_(tab) {}
+ explicit TabLink(int tab_node_id) : tab_node_id_(tab_node_id) {}
- void set_tab(const SyncedTabDelegate* tab) { tab_ = tab; }
void set_url(const GURL& url) { url_ = url; }
int tab_node_id() const { return tab_node_id_; }
- const SyncedTabDelegate* tab() const { return tab_; }
const GURL& url() const { return url_; }
private:
// The id for the sync node this tab is stored in.
const int tab_node_id_;
- // The tab object itself.
- const SyncedTabDelegate* tab_;
-
// The currently visible url of the tab (used for syncing favicons).
GURL url_;
@@ -183,20 +177,16 @@ class SessionsSyncManager : public syncer::SyncableService,
void InitializeCurrentMachineTag();
- // Load and add window or tab data for a foreign session to our internal
+ // Load and add window or tab data from synced specifics to our internal
// tracking.
- void UpdateTrackerWithForeignSession(
- const sync_pb::SessionSpecifics& specifics,
- const base::Time& modification_time);
+ void UpdateTrackerWithSpecifics(const sync_pb::SessionSpecifics& specifics,
+ const base::Time& modification_time);
// Returns true if |sync_data| contained a header node for the current
- // machine, false otherwise. |restored_tabs| is a filtered tab-only
- // subset of |sync_data| returned by this function for convenience.
- // |new_changes| is a link to the SyncChange pipeline that exists in the
- // caller's context. This function will append necessary changes for
- // processing later.
+ // machine, false otherwise. |new_changes| is a link to the SyncChange
+ // pipeline that exists in the caller's context. This function will append
+ // necessary changes for processing later.
bool InitFromSyncModel(const syncer::SyncDataList& sync_data,
- syncer::SyncDataList* restored_tabs,
syncer::SyncChangeList* new_changes);
// Helper to construct a deletion SyncChange for a *tab node*.
@@ -245,11 +235,6 @@ class SessionsSyncManager : public syncer::SyncableService,
// RELOAD_TABS will additionally cause a resync of all tabs (same as calling
// AssociateTabs with a vector of all tabs).
//
- // |restored_tabs| is a filtered tab-only subset of initial sync data, if
- // available (during MergeDataAndStartSyncing). It can be used to obtain
- // baseline SessionSpecifics for tabs we can't fully associate any other
- // way because they don't yet have a WebContents.
- //
// Returns: false if the local session's sync nodes were deleted and
// reassociation is necessary, true otherwise.
//
@@ -258,7 +243,6 @@ class SessionsSyncManager : public syncer::SyncableService,
// changes for processing later.
enum ReloadTabsOption { RELOAD_TABS, DONT_RELOAD_TABS };
void AssociateWindows(ReloadTabsOption option,
- const syncer::SyncDataList& restored_tabs,
syncer::SyncChangeList* change_output);
// Loads and reassociates the local tabs referenced in |tabs|.
@@ -278,6 +262,7 @@ class SessionsSyncManager : public syncer::SyncableService,
static void SetVariationIds(sessions::SessionTab* session_tab);
// Populates |specifics| based on the data in |tab_delegate|.
+ // Returns true on success, false on failure.
maxbogue 2016/11/10 06:43:26 Still looks void to me. This from an earlier revis
Nicolas Zea 2016/11/10 18:25:36 Woops, yes, removed.
void LocalTabDelegateToSpecifics(const SyncedTabDelegate& tab_delegate,
sync_pb::SessionSpecifics* specifics);
@@ -287,17 +272,10 @@ class SessionsSyncManager : public syncer::SyncableService,
// as they may have changed after a session was restored. This method
// compares new_tab_id and new_window_id against the previously persisted tab
// ID and window ID (from our TabNodePool) and updates them if either differs.
- // |restored_tabs| is a filtered tab-only subset of initial sync data, if
- // available (during MergeDataAndStartSyncing). It can be used to obtain
- // baseline SessionSpecifics for tabs we can't fully associate any other
- // way because they don't yet have a WebContents.
- // TODO(tim): Bug 98892. We should be able to test this for this on android
- // even though we didn't have tests for old API-based sessions sync.
void AssociateRestoredPlaceholderTab(
const SyncedTabDelegate& tab_delegate,
SessionID::id_type new_tab_id,
SessionID::id_type new_window_id,
- const syncer::SyncDataList& restored_tabs,
syncer::SyncChangeList* change_output);
// Stops and re-starts syncing to rebuild association mappings.

Powered by Google App Engine
This is Rietveld 408576698