diff options
author | qsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 17:49:08 +0000 |
---|---|---|
committer | qsr@google.com <qsr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 17:49:08 +0000 |
commit | f75f2f13fec0ec21942d900657bdb2a3cf2947c9 (patch) | |
tree | 0dd6f76f3892720002038c372834060bb41ae20e | |
parent | 5bcd914fec14d5fd2d4925faad5ff45661b9a724 (diff) | |
download | chromium_src-f75f2f13fec0ec21942d900657bdb2a3cf2947c9.zip chromium_src-f75f2f13fec0ec21942d900657bdb2a3cf2947c9.tar.gz chromium_src-f75f2f13fec0ec21942d900657bdb2a3cf2947c9.tar.bz2 |
In sync session interfaces, do not use directly SessionID.
BUG=
TEST=
Review URL: http://codereview.chromium.org/7529022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94711 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 19 insertions, 19 deletions
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 8ba5e61..227b5ee 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -135,7 +135,7 @@ void SessionModelAssociator::ReassociateWindows(bool reload_tabs) { if (ShouldSyncWindow(*i) && (*i)->GetTabCount() && (*i)->HasWindow()) { sync_pb::SessionWindow window_s; - SessionID::id_type window_id = (*i)->GetSessionId().id(); + SessionID::id_type window_id = (*i)->GetSessionId(); VLOG(1) << "Reassociating window " << window_id << " with " << (*i)->GetTabCount() << " tabs."; window_s.set_window_id(window_id); @@ -155,7 +155,7 @@ void SessionModelAssociator::ReassociateWindows(bool reload_tabs) { DCHECK(tab); if (IsValidTab(*tab)) { found_tabs = true; - window_s.add_tab(tab->GetSessionId().id()); + window_s.add_tab(tab->GetSessionId()); if (reload_tabs) { ReassociateTab(*tab); } @@ -216,7 +216,7 @@ void SessionModelAssociator::ReassociateTab(const SyncedTabDelegate& tab) { return; int64 sync_id; - SessionID::id_type id = tab.GetSessionId().id(); + SessionID::id_type id = tab.GetSessionId(); if (tab.IsBeingDestroyed()) { // This tab is closing. TabLinksMap::iterator tab_iter = tab_map_.find(id); @@ -243,10 +243,10 @@ void SessionModelAssociator::ReassociateTab(const SyncedTabDelegate& tab) { void SessionModelAssociator::Associate(const SyncedTabDelegate* tab, int64 sync_id) { DCHECK(CalledOnValidThread()); - SessionID::id_type session_id = tab->GetSessionId().id(); + SessionID::id_type session_id = tab->GetSessionId(); const SyncedWindowDelegate* window = SyncedWindowDelegate::FindSyncedWindowDelegateWithId( - tab->GetWindowId().id()); + tab->GetWindowId()); if (!window) { // Can happen for weird things like developer console. tab_pool_.FreeTabNode(sync_id); return; @@ -276,9 +276,9 @@ bool SessionModelAssociator::WriteTabContentsToSyncModel( session_s.set_session_tag(GetCurrentMachineTag()); sync_pb::SessionTab* tab_s = session_s.mutable_tab(); - SessionID::id_type tab_id = tab.GetSessionId().id(); + SessionID::id_type tab_id = tab.GetSessionId(); tab_s->set_tab_id(tab_id); - tab_s->set_window_id(tab.GetWindowId().id()); + tab_s->set_window_id(tab.GetWindowId()); const int current_index = tab.GetCurrentEntryIndex(); const int min_index = std::max(0, current_index - max_sync_navigation_count); diff --git a/chrome/browser/sync/glue/synced_tab_delegate.h b/chrome/browser/sync/glue/synced_tab_delegate.h index 9c0263c..0b576f0 100644 --- a/chrome/browser/sync/glue/synced_tab_delegate.h +++ b/chrome/browser/sync/glue/synced_tab_delegate.h @@ -21,8 +21,8 @@ class SyncedTabDelegate { public: // Method from TabContentsWrapper. - virtual const SessionID& GetWindowId() const = 0; - virtual const SessionID& GetSessionId() const = 0; + virtual SessionID::id_type GetWindowId() const = 0; + virtual SessionID::id_type GetSessionId() const = 0; virtual bool IsBeingDestroyed() const = 0; virtual Profile* profile() const = 0; diff --git a/chrome/browser/sync/glue/synced_window_delegate.h b/chrome/browser/sync/glue/synced_window_delegate.h index e847784..2f0a694 100644 --- a/chrome/browser/sync/glue/synced_window_delegate.h +++ b/chrome/browser/sync/glue/synced_window_delegate.h @@ -35,7 +35,7 @@ class SyncedWindowDelegate { virtual bool HasWindow() const = 0; // see Browser::session_id - virtual const SessionID& GetSessionId() const = 0; + virtual SessionID::id_type GetSessionId() const = 0; // see Browser::tab_count virtual int GetTabCount() const = 0; diff --git a/chrome/browser/ui/browser_synced_window_delegate.cc b/chrome/browser/ui/browser_synced_window_delegate.cc index 2db073b..2fd1408 100644 --- a/chrome/browser/ui/browser_synced_window_delegate.cc +++ b/chrome/browser/ui/browser_synced_window_delegate.cc @@ -60,8 +60,8 @@ bool BrowserSyncedWindowDelegate::HasWindow() const { return browser_->window() != NULL; } -const SessionID& BrowserSyncedWindowDelegate::GetSessionId() const { - return browser_->session_id(); +SessionID::id_type BrowserSyncedWindowDelegate::GetSessionId() const { + return browser_->session_id().id(); } int BrowserSyncedWindowDelegate::GetTabCount() const { diff --git a/chrome/browser/ui/browser_synced_window_delegate.h b/chrome/browser/ui/browser_synced_window_delegate.h index d598b97..1b9f6cb 100644 --- a/chrome/browser/ui/browser_synced_window_delegate.h +++ b/chrome/browser/ui/browser_synced_window_delegate.h @@ -25,7 +25,7 @@ class BrowserSyncedWindowDelegate : public browser_sync::SyncedWindowDelegate { // SyncedWindowDelegate: virtual bool HasWindow() const OVERRIDE; - virtual const SessionID& GetSessionId() const OVERRIDE; + virtual SessionID::id_type GetSessionId() const OVERRIDE; virtual int GetTabCount() const OVERRIDE; virtual int GetActiveIndex() const OVERRIDE; virtual bool IsApp() const OVERRIDE; diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.cc index 72304f8..2c72807 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.cc @@ -17,12 +17,12 @@ TabContentsWrapperSyncedTabDelegate::TabContentsWrapperSyncedTabDelegate( TabContentsWrapperSyncedTabDelegate::~TabContentsWrapperSyncedTabDelegate() {} -const SessionID& TabContentsWrapperSyncedTabDelegate::GetWindowId() const { - return tab_contents_wrapper_->restore_tab_helper()->window_id(); +SessionID::id_type TabContentsWrapperSyncedTabDelegate::GetWindowId() const { + return tab_contents_wrapper_->restore_tab_helper()->window_id().id(); } -const SessionID& TabContentsWrapperSyncedTabDelegate::GetSessionId() const { - return tab_contents_wrapper_->restore_tab_helper()->session_id(); +SessionID::id_type TabContentsWrapperSyncedTabDelegate::GetSessionId() const { + return tab_contents_wrapper_->restore_tab_helper()->session_id().id(); } bool TabContentsWrapperSyncedTabDelegate::IsBeingDestroyed() const { diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.h index b3e8416..e71b31e 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.h +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper_synced_tab_delegate.h @@ -20,8 +20,8 @@ class TabContentsWrapperSyncedTabDelegate virtual ~TabContentsWrapperSyncedTabDelegate(); // Methods from SyncedTabDelegate. - virtual const SessionID& GetWindowId() const OVERRIDE; - virtual const SessionID& GetSessionId() const OVERRIDE; + virtual SessionID::id_type GetWindowId() const OVERRIDE; + virtual SessionID::id_type GetSessionId() const OVERRIDE; virtual bool IsBeingDestroyed() const OVERRIDE; virtual Profile* profile() const OVERRIDE; virtual bool HasExtensionAppId() const OVERRIDE; |