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

Unified Diff: chrome/browser/sync/glue/session_model_associator.h

Issue 10125002: [Sync] Add per-navigation timestamps/unique ids to tab sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 8 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 | « chrome/browser/sessions/session_types.h ('k') | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/session_model_associator.h
diff --git a/chrome/browser/sync/glue/session_model_associator.h b/chrome/browser/sync/glue/session_model_associator.h
index 50d86b17497fe16afc5d704d3ef01550ce49dc61..ef3265d63ffbc187c3cd6d5543604e9565226928 100644
--- a/chrome/browser/sync/glue/session_model_associator.h
+++ b/chrome/browser/sync/glue/session_model_associator.h
@@ -36,6 +36,10 @@ class Prefservice;
class Profile;
class ProfileSyncService;
+namespace content {
+class NavigationEntry;
+} // namespace content
+
namespace sync_api {
class BaseTransaction;
class ReadNode;
@@ -292,6 +296,7 @@ class SessionModelAssociator
// A pool for managing free/used tab sync nodes. Performs lazy creation
// of sync nodes when necessary.
+ // TODO(zea): pull this into its own file.
class TabNodePool {
public:
explicit TabNodePool(ProfileSyncService* sync_service);
@@ -411,6 +416,17 @@ class SessionModelAssociator
// if no page is found to be referring to the favicon anymore.
void DecrementAndCleanFaviconForURL(const std::string& page_url);
+ // Helper method to build sync's tab specifics from a newly modified
+ // tab, window, and the locally stored previous tab data. After completing,
+ // |prev_tab| will be updated to reflect the current data, |sync_tab| will
+ // be filled with the tab data (preserving old timestamps as necessary), and
+ // |new_url| will be the tab's current url.
+ void AssociateTabContents(const SyncedWindowDelegate& window,
+ const SyncedTabDelegate& new_tab,
+ SyncedSessionTab* prev_tab,
+ sync_pb::SessionTab* sync_tab,
+ GURL* new_url);
+
// Load the favicon for the tab specified by |tab_link|. Will cancel any
// outstanding request for this tab. OnFaviconDataAvailable(..) will be called
// when the load completes.
@@ -440,21 +456,21 @@ class SessionModelAssociator
// Used to populate a session tab from the session specifics tab provided.
static void PopulateSessionTabFromSpecifics(const sync_pb::SessionTab& tab,
const base::Time& mtime,
- SessionTab* session_tab);
+ SyncedSessionTab* session_tab);
// Helper method to load the favicon data from the tab specifics. If the
// favicon is valid, stores the favicon data and increments the usage counter
// in |synced_favicons_| and updates |synced_favicon_pages_| appropriately.
void LoadForeignTabFavicon(const sync_pb::SessionTab& tab);
- // Used to populate a session tab from the session specifics tab provided.
+ // Append a new navigation from sync specifics onto |tab| navigation vectors.
static void AppendSessionTabNavigation(
const sync_pb::TabNavigation& navigation,
- std::vector<TabNavigation>* navigations);
+ SyncedSessionTab* tab);
// Populates the navigation portion of the session specifics.
static void PopulateSessionSpecificsNavigation(
- const TabNavigation* navigation,
+ const content::NavigationEntry& navigation,
sync_pb::TabNavigation* tab_navigation);
// Returns true if this tab belongs to this profile and belongs to a window,
« no previous file with comments | « chrome/browser/sessions/session_types.h ('k') | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698