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

Unified Diff: components/sync_sessions/synced_session.h

Issue 2499023004: [Sync] Introduce SyncedSessionWindow type. (Closed)
Patch Set: Address comments Created 3 years, 9 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_sessions/synced_session.h
diff --git a/components/sync_sessions/synced_session.h b/components/sync_sessions/synced_session.h
index e0defd96623490463ba4a8182e13dae483b711c4..c3471ae20d435c83e3fe5673943f2d264a99beef 100644
--- a/components/sync_sessions/synced_session.h
+++ b/components/sync_sessions/synced_session.h
@@ -16,12 +16,26 @@
#include "components/sessions/core/session_types.h"
#include "components/sync/protocol/session_specifics.pb.h"
-namespace sessions {
-struct SessionWindow;
-}
-
namespace sync_sessions {
+// A Sync wrapper for a SessionWindow.
+struct SyncedSessionWindow {
+ SyncedSessionWindow();
+ ~SyncedSessionWindow();
+
+ // Convert this object into its sync protocol buffer equivalent.
+ sync_pb::SessionWindow ToSessionWindowProto() const;
+
+ // Type of the window. See session_specifics.proto.
+ sync_pb::SessionWindow::BrowserType window_type;
+
+ // The SessionWindow this object wraps.
+ sessions::SessionWindow wrapped_window;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SyncedSessionWindow);
+};
+
// Defines a synced session for use by session sync. A synced session is a
// list of windows along with a unique session identifer (tag) and meta-data
// about the device being synced.
@@ -55,8 +69,7 @@ struct SyncedSession {
base::Time modified_time;
// Map of windows that make up this session.
- std::map<SessionID::id_type, std::unique_ptr<sessions::SessionWindow>>
- windows;
+ std::map<SessionID::id_type, std::unique_ptr<SyncedSessionWindow>> windows;
// A tab node id is part of the identifier for the sync tab objects. Tab node
// ids are not used for interacting with the model/browser tabs. However, when
@@ -95,7 +108,7 @@ struct SyncedSession {
// Convert this object to its protocol buffer equivalent. Shallow conversion,
// does not create SessionTab protobufs.
- sync_pb::SessionHeader ToSessionHeader() const;
+ sync_pb::SessionHeader ToSessionHeaderProto() const;
private:
DISALLOW_COPY_AND_ASSIGN(SyncedSession);
« no previous file with comments | « components/sync_sessions/sync_sessions_metrics_unittest.cc ('k') | components/sync_sessions/synced_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698