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

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: Add back NOTREACHED() and a return for gcc 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..11bf51c97f90c1a92a8d72460b59be41b6c056ce 100644
--- a/components/sessions/core/tab_restore_service.cc
+++ b/components/sessions/core/tab_restore_service.cc
@@ -15,70 +15,19 @@ 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() : id(next_entry_id++) {}
+TabRestoreService::Entry::~Entry() = default;
-TabRestoreService::Entry::Entry(Type type)
- : id(next_entry_id++),
- type(type),
- from_last_session(false) {}
-
-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::Tab::Tab() = default;
+TabRestoreService::Tab::~Tab() = default;
+TabRestoreService::Type TabRestoreService::Tab::type() const {
+ return TAB;
}
-TabRestoreService::Window::~Window() {
+TabRestoreService::Window::Window() = default;
+TabRestoreService::Window::~Window() = default;
+TabRestoreService::Type TabRestoreService::Window::type() const {
+ return WINDOW;
}
// TabRestoreService ----------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698