Commit 5b74b87c authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Remove default constructor for SessionID

It was recently deprecated in favor of the less subtle
SessionID::NewUnique(), with the same implementation. This patch
removes the deprecated API which includes the aforementioned default
constructor as well as SessionID::set_id().

Most calling sites have been migrated in recent CLs and the remaining
ones are now surfaced, both intentional and accidental.

The plan for follow-up patches will consider:
1. Reintroducing the default constructor, but with
   SessionID::InvalidValue() as the default.
2. Moving SessionID::NewUnique() to a factory method in a newly
   introduced KeyedService for this purpose.

Bug: 823798
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I3abbc9b5a1497c11a99c9f80c6b2eadb7b7c6df8
Reviewed-on: https://chromium-review.googlesource.com/995899
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarrajendrant <rajendrant@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550127}
parent aacb7cf3
......@@ -184,6 +184,8 @@ void TabAndroid::AttachTabHelpers(content::WebContents* web_contents) {
TabAndroid::TabAndroid(JNIEnv* env, const JavaRef<jobject>& obj)
: weak_java_tab_(env, obj),
session_tab_id_(SessionID::NewUnique()),
session_window_id_(SessionID::InvalidValue()),
content_layer_(cc::Layer::Create()),
tab_content_manager_(NULL),
synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)),
......@@ -417,8 +419,8 @@ void TabAndroid::InitWebContents(
SetWindowSessionID(session_window_id_);
session_tab_id_.set_id(
SessionTabHelper::FromWebContents(web_contents())->session_id().id());
session_tab_id_ =
SessionTabHelper::FromWebContents(web_contents())->session_id();
ContextMenuHelper::FromWebContents(web_contents())->SetPopulator(
jcontext_menu_populator);
ViewAndroidHelper::FromWebContents(web_contents())->
......
......@@ -24,6 +24,13 @@ namespace {
typedef base::OnceCallback<SessionID(void)> TabIdGetter;
typedef base::OnceCallback<void(SessionID)> TabIdCallback;
// Temporary workaround because base::PostTaskAndReplyWithResult() does not
// support types without a default constructor.
// TODO(crbug.com/823798): Revert once a default constructor is reintroduced.
SessionID::id_type WrapTabIdGetter(TabIdGetter tab_id_getter) {
return std::move(tab_id_getter).Run().id();
}
} // namespace
// Object that can run a list of callbacks that take tab IDs. New callbacks
......@@ -44,7 +51,7 @@ class TabIdProvider::CallbackRunner {
// Runs all the callbacks in the order that they were added. This method must
// not be called more than once.
void RunAll(SessionID tab_info) {
void RunAll(SessionID::id_type tab_info_value) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!is_done_);
is_done_ = true;
......@@ -52,6 +59,7 @@ class TabIdProvider::CallbackRunner {
std::vector<TabIdCallback> running_callbacks;
running_callbacks.swap(callbacks_);
SessionID tab_info = SessionID::FromSerializedValue(tab_info_value);
for (auto& callback : running_callbacks)
std::move(callback).Run(tab_info);
}
......@@ -84,7 +92,8 @@ TabIdProvider::TabIdProvider(base::TaskRunner* task_runner,
// -1 to OnTabIdReady, so that case doesn't need to be explicitly handled
// here.
base::PostTaskAndReplyWithResult(
task_runner, from_here, std::move(tab_id_getter),
task_runner, from_here,
base::BindOnce(&WrapTabIdGetter, std::move(tab_id_getter)),
base::BindOnce(&CallbackRunner::RunAll,
base::Owned(callback_runner.release())));
}
......
......@@ -68,14 +68,15 @@ class PersistentTabRestoreTimeFactory
class PersistentTabRestoreServiceTest : public ChromeRenderViewHostTestHarness {
public:
PersistentTabRestoreServiceTest()
: url1_("http://1"),
url2_("http://2"),
url3_("http://3"),
user_agent_override_(
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19"
" (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19"),
time_factory_(NULL) {
}
: url1_("http://1"),
url2_("http://2"),
url3_("http://3"),
user_agent_override_(
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19"
" (KHTML, like Gecko) Chrome/18.0.1025.45 Safari/535.19"),
time_factory_(NULL),
window_id_(SessionID::FromSerializedValue(1)),
tab_id_(SessionID::FromSerializedValue(2)) {}
~PersistentTabRestoreServiceTest() override {}
......@@ -142,8 +143,8 @@ class PersistentTabRestoreServiceTest : public ChromeRenderViewHostTestHarness {
// If |pinned| is true, the tab is marked as pinned in the session service.
void AddWindowWithOneTabToSessionService(bool pinned) {
// Create new window / tab IDs so that these remain distinct.
window_id_ = SessionID();
tab_id_ = SessionID();
window_id_ = SessionID::NewUnique();
tab_id_ = SessionID::NewUnique();
SessionService* session_service =
SessionServiceFactory::GetForProfile(profile());
......
......@@ -108,7 +108,7 @@ class SessionServiceTest : public BrowserWithTestWindowTest {
// pinned state of the tab is updated. The session service is then recreated
// and the pinned state of the read back tab is returned.
bool CreateAndWriteSessionWithOneTab(bool pinned_state, bool write_always) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
SerializedNavigationEntry nav1 =
SerializedNavigationEntryTestHelper::CreateNavigation(
"http://google.com", "abc");
......@@ -166,7 +166,7 @@ class SessionServiceTest : public BrowserWithTestWindowTest {
const std::string window_workspace = "abc";
SessionID window_id;
const SessionID window_id = SessionID::NewUnique();
// Path used in testing.
base::ScopedTempDir temp_dir_;
......@@ -176,7 +176,7 @@ class SessionServiceTest : public BrowserWithTestWindowTest {
};
TEST_F(SessionServiceTest, Basic) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
SerializedNavigationEntry nav1 =
......@@ -207,7 +207,7 @@ TEST_F(SessionServiceTest, Basic) {
// Make sure we persist post entries.
TEST_F(SessionServiceTest, PersistPostData) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
SerializedNavigationEntry nav1 =
......@@ -225,8 +225,8 @@ TEST_F(SessionServiceTest, PersistPostData) {
}
TEST_F(SessionServiceTest, ClosingTabStaysClosed) {
SessionID tab_id;
SessionID tab2_id;
SessionID tab_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
ASSERT_NE(tab_id, tab2_id);
SerializedNavigationEntry nav1 =
......@@ -258,7 +258,7 @@ TEST_F(SessionServiceTest, ClosingTabStaysClosed) {
}
TEST_F(SessionServiceTest, Pruning) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
SerializedNavigationEntry nav1 =
SerializedNavigationEntryTestHelper::CreateNavigation(
......@@ -294,9 +294,9 @@ TEST_F(SessionServiceTest, Pruning) {
}
TEST_F(SessionServiceTest, TwoWindows) {
SessionID window2_id;
SessionID tab1_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab1_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
SerializedNavigationEntry nav1;
SerializedNavigationEntry nav2;
......@@ -338,9 +338,9 @@ TEST_F(SessionServiceTest, TwoWindows) {
}
TEST_F(SessionServiceTest, WindowWithNoTabsGetsPruned) {
SessionID window2_id;
SessionID tab1_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab1_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
SerializedNavigationEntry nav1 =
SerializedNavigationEntryTestHelper::CreateNavigation(
......@@ -372,8 +372,8 @@ TEST_F(SessionServiceTest, WindowWithNoTabsGetsPruned) {
}
TEST_F(SessionServiceTest, ClosingWindowDoesntCloseTabs) {
SessionID tab_id;
SessionID tab2_id;
SessionID tab_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
ASSERT_NE(tab_id, tab2_id);
SerializedNavigationEntry nav1 =
......@@ -409,9 +409,9 @@ TEST_F(SessionServiceTest, ClosingWindowDoesntCloseTabs) {
}
TEST_F(SessionServiceTest, LockingWindowRemembersAll) {
SessionID window2_id;
SessionID tab1_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab1_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
SerializedNavigationEntry nav1;
SerializedNavigationEntry nav2;
......@@ -440,9 +440,9 @@ TEST_F(SessionServiceTest, LockingWindowRemembersAll) {
}
TEST_F(SessionServiceTest, WindowCloseCommittedAfterNavigate) {
SessionID window2_id;
SessionID tab_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
ASSERT_NE(window2_id, window_id);
service()->SetWindowType(window2_id,
......@@ -484,9 +484,9 @@ TEST_F(SessionServiceTest, WindowCloseCommittedAfterNavigate) {
// Makes sure we don't track popups.
TEST_F(SessionServiceTest, IgnorePopups) {
SessionID window2_id;
SessionID tab_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
ASSERT_NE(window2_id, window_id);
service()->SetWindowType(window2_id,
......@@ -538,9 +538,9 @@ TEST_F(SessionServiceTest, RemoveUnusedRestoreWindowsTest) {
#if defined (OS_CHROMEOS)
// Makes sure we track apps. Only applicable on chromeos.
TEST_F(SessionServiceTest, RestoreApp) {
SessionID window2_id;
SessionID tab_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
ASSERT_NE(window2_id, window_id);
service()->SetWindowType(window2_id,
......@@ -594,7 +594,7 @@ TEST_F(SessionServiceTest, RestoreApp) {
// Tests pruning from the front.
TEST_F(SessionServiceTest, PruneFromFront) {
const std::string base_url("http://google.com/");
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
helper_.PrepareTabInWindow(window_id, tab_id, 0, true);
......@@ -637,7 +637,7 @@ TEST_F(SessionServiceTest, PruneFromFront) {
// Prunes from front so that we have no entries.
TEST_F(SessionServiceTest, PruneToEmpty) {
const std::string base_url("http://google.com/");
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
helper_.PrepareTabInWindow(window_id, tab_id, 0, true);
......@@ -677,7 +677,7 @@ TEST_F(SessionServiceTest, PinnedTrue) {
// Make sure application extension ids are persisted.
TEST_F(SessionServiceTest, PersistApplicationExtensionID) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
std::string app_id("foo");
......@@ -698,7 +698,7 @@ TEST_F(SessionServiceTest, PersistApplicationExtensionID) {
// Check that user agent overrides are persisted.
TEST_F(SessionServiceTest, PersistUserAgentOverrides) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
std::string user_agent_override = "Mozilla/5.0 (X11; Linux x86_64) "
"AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.45 "
......@@ -725,7 +725,7 @@ TEST_F(SessionServiceTest, PersistUserAgentOverrides) {
// Makes sure a tab closed by a user gesture is not restored.
TEST_F(SessionServiceTest, CloseTabUserGesture) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
SerializedNavigationEntry nav1 =
......@@ -744,7 +744,7 @@ TEST_F(SessionServiceTest, CloseTabUserGesture) {
// Verifies SetWindowBounds maps SHOW_STATE_DEFAULT to SHOW_STATE_NORMAL.
TEST_F(SessionServiceTest, DontPersistDefault) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
SerializedNavigationEntry nav1 =
SerializedNavigationEntryTestHelper::CreateNavigation(
......@@ -762,7 +762,7 @@ TEST_F(SessionServiceTest, DontPersistDefault) {
}
TEST_F(SessionServiceTest, KeepPostDataWithoutPasswords) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
// Create a page state representing a HTTP body without posted passwords.
......@@ -803,7 +803,7 @@ TEST_F(SessionServiceTest, KeepPostDataWithoutPasswords) {
}
TEST_F(SessionServiceTest, RemovePostDataWithPasswords) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
ASSERT_NE(window_id, tab_id);
// Create a page state representing a HTTP body with posted passwords.
......@@ -834,7 +834,7 @@ TEST_F(SessionServiceTest, RemovePostDataWithPasswords) {
TEST_F(SessionServiceTest, ReplacePendingNavigation) {
const std::string base_url("http://google.com/");
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
helper_.PrepareTabInWindow(window_id, tab_id, 0, true);
......@@ -865,7 +865,7 @@ TEST_F(SessionServiceTest, ReplacePendingNavigation) {
TEST_F(SessionServiceTest, ReplacePendingNavigationAndPrune) {
const std::string base_url("http://google.com/");
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
helper_.PrepareTabInWindow(window_id, tab_id, 0, true);
......@@ -901,9 +901,9 @@ TEST_F(SessionServiceTest, ReplacePendingNavigationAndPrune) {
}
TEST_F(SessionServiceTest, RestoreActivation1) {
SessionID window2_id;
SessionID tab1_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab1_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
SerializedNavigationEntry nav1;
SerializedNavigationEntry nav2;
......@@ -923,9 +923,9 @@ TEST_F(SessionServiceTest, RestoreActivation1) {
// It's easier to have two separate tests with setup/teardown than to manualy
// reset the state for the different flavors of the test.
TEST_F(SessionServiceTest, RestoreActivation2) {
SessionID window2_id;
SessionID tab1_id;
SessionID tab2_id;
SessionID window2_id = SessionID::NewUnique();
SessionID tab1_id = SessionID::NewUnique();
SessionID tab2_id = SessionID::NewUnique();
SerializedNavigationEntry nav1;
SerializedNavigationEntry nav2;
......@@ -946,7 +946,7 @@ TEST_F(SessionServiceTest, RestoreActivation2) {
// Makes sure we don't track blacklisted URLs.
TEST_F(SessionServiceTest, IgnoreBlacklistedUrls) {
SessionID tab_id;
SessionID tab_id = SessionID::NewUnique();
SerializedNavigationEntry nav1 =
SerializedNavigationEntryTestHelper::CreateNavigation(
......
......@@ -232,7 +232,8 @@ bool GetLocalWindows(int index, ScopedWindowMap* local_windows) {
const sessions::SessionWindow& window = w->second->wrapped_window;
std::unique_ptr<sync_sessions::SyncedSessionWindow> new_window =
std::make_unique<sync_sessions::SyncedSessionWindow>();
new_window->wrapped_window.window_id.set_id(window.window_id.id());
new_window->wrapped_window.window_id =
SessionID::FromSerializedValue(window.window_id.id());
for (size_t t = 0; t < window.tabs.size(); ++t) {
const sessions::SessionTab& tab = *window.tabs.at(t);
std::unique_ptr<sessions::SessionTab> new_tab =
......
......@@ -25,7 +25,8 @@ TabModel::TabModel(Profile* profile, bool is_tabbed_activity)
live_tab_context_(new AndroidLiveTabContext(this)),
synced_window_delegate_(
new browser_sync::SyncedWindowDelegateAndroid(this,
is_tabbed_activity)) {
is_tabbed_activity)),
session_id_(SessionID::NewUnique()) {
if (profile) {
// A normal Profile creates an OTR profile if it does not exist when
// GetOffTheRecordProfile() is called, so we guard it with
......
......@@ -367,6 +367,7 @@ Browser::Browser(const CreateParams& params)
params.profile)),
app_name_(params.app_name),
is_trusted_source_(params.trusted_source),
session_id_(SessionID::NewUnique()),
cancel_download_confirmation_state_(NOT_PROMPTED),
override_bounds_(params.initial_bounds),
initial_show_state_(params.initial_show_state),
......
......@@ -64,7 +64,10 @@ void SettingsWindowManager::ShowChromePageForProfile(Profile* profile,
params.user_gesture = true;
params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
Navigate(&params);
settings_session_map_[profile] = params.browser->session_id();
// operator[] not used because SessionID has no default constructor.
settings_session_map_.emplace(profile, SessionID::InvalidValue())
.first->second = params.browser->session_id();
DCHECK(params.browser->is_trusted_source());
for (SettingsWindowManagerObserver& observer : observers_)
......
......@@ -34,7 +34,7 @@ struct WindowMetrics {
bool operator!=(const WindowMetrics& other) { return !operator==(other); }
// ID for the window, unique within the Chrome session.
SessionID window_id;
SessionID window_id = SessionID::InvalidValue();
WindowMetricsEvent::Type type;
// TODO(michaelpg): Observe the show state and log when it changes.
WindowMetricsEvent::ShowState show_state;
......
......@@ -372,8 +372,8 @@ TEST_F(RecentTabsSubMenuModelTest,
SessionService* session_service = new SessionService(profile());
SessionServiceFactory::SetForTestProfile(profile(),
base::WrapUnique(session_service));
SessionID tab_id;
SessionID window_id;
SessionID tab_id = SessionID::FromSerializedValue(1);
SessionID window_id = SessionID::FromSerializedValue(2);
session_service->SetWindowType(window_id,
Browser::TYPE_TABBED,
SessionService::TYPE_NORMAL);
......
......@@ -21,7 +21,8 @@
#include "ui/gfx/image/image_skia.h"
TestOmniboxClient::TestOmniboxClient()
: autocomplete_classifier_(
: session_id_(SessionID::FromSerializedValue(1)),
autocomplete_classifier_(
std::make_unique<AutocompleteController>(
CreateAutocompleteProviderClient(),
nullptr,
......
......@@ -10,11 +10,7 @@ static SessionID::id_type next_id = 1;
// static
SessionID SessionID::NewUnique() {
return SessionID();
}
SessionID::SessionID() {
id_ = next_id++;
return SessionID(next_id++);
}
std::ostream& operator<<(std::ostream& out, SessionID id) {
......
......@@ -34,18 +34,12 @@ class SESSIONS_EXPORT SessionID {
// SessionID instance. Note that zero is also considered invalid.
static constexpr bool IsValidValue(id_type value) { return value > 0; }
// Generates a new unique ID (deprecated: use NewUnique() instead).
SessionID();
// All IDs are valid except InvalidValue() above.
bool is_valid() const { return IsValidValue(id_); }
// Returns the underlying id.
id_type id() const { return id_; }
// Sets underlying type (deprecated: use FromSerializedValue() instead).
void set_id(id_type id) { id_ = id; }
struct Hasher {
inline std::size_t operator()(SessionID id) const { return id.id(); }
};
......
......@@ -39,8 +39,8 @@ TEST(SessionTab, FromSyncData) {
}
sessions::SessionTab tab;
tab.window_id.set_id(100);
tab.tab_id.set_id(100);
tab.window_id = SessionID::FromSerializedValue(100);
tab.tab_id = SessionID::FromSerializedValue(100);
tab.tab_visual_index = 100;
tab.current_navigation_index = 1000;
tab.pinned = false;
......@@ -74,8 +74,8 @@ TEST(SessionTab, FromSyncData) {
TEST(SessionTab, ToSyncData) {
sessions::SessionTab tab;
tab.window_id.set_id(10);
tab.tab_id.set_id(5);
tab.window_id = SessionID::FromSerializedValue(10);
tab.tab_id = SessionID::FromSerializedValue(5);
tab.tab_visual_index = 13;
tab.current_navigation_index = 3;
tab.pinned = true;
......
......@@ -454,8 +454,8 @@ bool SessionsSyncManager::InitFromSyncModel(
// the specifics in place.
for (auto& window :
*rewritten_specifics.mutable_header()->mutable_window()) {
session_id_map[window.window_id()] = SessionID::NewUnique();
window.set_window_id(session_id_map[window.window_id()].id());
session_id_map.emplace(window.window_id(), SessionID::NewUnique());
window.set_window_id(session_id_map.at(window.window_id()).id());
google::protobuf::RepeatedField<int>* tab_ids = window.mutable_tab();
for (int i = 0; i < tab_ids->size(); i++) {
......@@ -463,9 +463,9 @@ bool SessionsSyncManager::InitFromSyncModel(
if (tab_iter == session_id_map.end()) {
// SessionID::SessionID() automatically increments a static
// variable, forcing a new id to be generated each time.
session_id_map[tab_ids->Get(i)] = SessionID::NewUnique();
session_id_map.emplace(tab_ids->Get(i), SessionID::NewUnique());
}
*(tab_ids->Mutable(i)) = session_id_map[tab_ids->Get(i)].id();
*(tab_ids->Mutable(i)) = session_id_map.at(tab_ids->Get(i)).id();
// Note: the tab id of the SessionTab will be updated when the tab
// node itself is processed.
}
......
......@@ -241,6 +241,7 @@ AppWindow::AppWindow(BrowserContext* context,
const Extension* extension)
: browser_context_(context),
extension_id_(extension->id()),
session_id_(SessionID::NewUnique()),
app_delegate_(app_delegate),
image_loader_ptr_factory_(this) {
ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
......
......@@ -10,8 +10,9 @@
DEFINE_WEB_STATE_USER_DATA_KEY(IOSChromeSessionTabHelper);
IOSChromeSessionTabHelper::IOSChromeSessionTabHelper(web::WebState* web_state) {
}
IOSChromeSessionTabHelper::IOSChromeSessionTabHelper(web::WebState* web_state)
: session_id_(SessionID::NewUnique()),
window_id_(SessionID::InvalidValue()) {}
IOSChromeSessionTabHelper::~IOSChromeSessionTabHelper() {}
......
......@@ -24,7 +24,7 @@
TabRestoreServiceDelegateImplIOS::TabRestoreServiceDelegateImplIOS(
ios::ChromeBrowserState* browser_state)
: browser_state_(browser_state) {}
: browser_state_(browser_state), session_id_(SessionID::NewUnique()) {}
TabRestoreServiceDelegateImplIOS::~TabRestoreServiceDelegateImplIOS() {}
......
......@@ -17,7 +17,7 @@
TabModelSyncedWindowDelegate::TabModelSyncedWindowDelegate(
WebStateList* web_state_list)
: web_state_list_(web_state_list) {
: web_state_list_(web_state_list), session_id_(SessionID::NewUnique()) {
web_state_list_->AddObserver(this);
for (int index = 0; index < web_state_list_->count(); ++index) {
SetWindowIdForWebState(web_state_list_->GetWebStateAt(index));
......
......@@ -58,7 +58,7 @@ void AddTabToDistantSession(const sessions::SessionTab& session_tab,
namespace synced_sessions {
DistantTab::DistantTab() {}
DistantTab::DistantTab() : tab_id(SessionID::InvalidValue()) {}
size_t DistantTab::hashOfUserVisibleProperties() {
std::stringstream ss;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment