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

Unified Diff: components/sessions/core/tab_restore_service.cc

Issue 2200993004: Make TabRestoreService::Entry noncopyable and fix up surrounding code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab-test-cleanup
Patch Set: Get session ID from entries, take tabs' active status directly instead of an index Created 4 years, 4 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/sessions/core/tab_restore_service.cc
diff --git a/components/sessions/core/tab_restore_service.cc b/components/sessions/core/tab_restore_service.cc
index c440faf33279c20c658b88abbe03f02e3e9c3895..8bf31952e703bbb88e0ab30d3ff8cd1ae0bbb61a 100644
--- a/components/sessions/core/tab_restore_service.cc
+++ b/components/sessions/core/tab_restore_service.cc
@@ -15,71 +15,14 @@ TabRestoreService::TimeFactory::~TimeFactory() {}
// ID of the next Entry.
static SessionID::id_type next_entry_id = 1;
-TabRestoreService::Entry::Entry()
- : id(next_entry_id++),
- type(TAB),
- from_last_session(false) {}
+TabRestoreService::Entry::~Entry() = default;
+TabRestoreService::Entry::Entry(Type type) : id(next_entry_id++), type(type) {}
-TabRestoreService::Entry::Entry(Type type)
- : id(next_entry_id++),
- type(type),
- from_last_session(false) {}
+TabRestoreService::Tab::Tab() : Entry(TAB) {}
+TabRestoreService::Tab::~Tab() = default;
-TabRestoreService::Entry::~Entry() {}
-
-// Tab ------------------------------------------------------------------------
-
-TabRestoreService::Tab::Tab()
- : Entry(TAB),
- current_navigation_index(-1),
- browser_id(0),
- tabstrip_index(-1),
- pinned(false) {
-}
-
-TabRestoreService::Tab::Tab(const TabRestoreService::Tab& tab)
- : Entry(tab),
- navigations(tab.navigations),
- current_navigation_index(tab.current_navigation_index),
- browser_id(tab.browser_id),
- tabstrip_index(tab.tabstrip_index),
- pinned(tab.pinned),
- extension_app_id(tab.extension_app_id),
- user_agent_override(tab.user_agent_override) {
- if (tab.platform_data)
- platform_data = tab.platform_data->Clone();
-}
-
-TabRestoreService::Tab::~Tab() {
-}
-
-TabRestoreService::Tab& TabRestoreService::Tab::operator=(
- const TabRestoreService::Tab& tab) {
- id = tab.id;
- type = tab.type;
- timestamp = tab.timestamp;
- from_last_session = tab.from_last_session;
- navigations = tab.navigations;
- current_navigation_index = tab.current_navigation_index;
- browser_id = tab.browser_id;
- tabstrip_index = tab.tabstrip_index;
- pinned = tab.pinned;
- extension_app_id = tab.extension_app_id;
- user_agent_override = tab.user_agent_override;
-
- if (tab.platform_data)
- platform_data = tab.platform_data->Clone();
-
- return *this;
-}
-
-// Window ---------------------------------------------------------------------
-
-TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) {
-}
-
-TabRestoreService::Window::~Window() {
-}
+TabRestoreService::Window::Window() : Entry(WINDOW) {}
+TabRestoreService::Window::~Window() = default;
// TabRestoreService ----------------------------------------------------------
« no previous file with comments | « components/sessions/core/tab_restore_service.h ('k') | components/sessions/core/tab_restore_service_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698