summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:03:54 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:03:54 +0000
commit3a3d4747769aec2954a2ca21de4812c5892994aa (patch)
treedb112f2c73cc39e9d6088059eae1fc9d35b74920 /chrome/browser/sessions
parent2235b22b88260fde392b753b5d7bb7904e5efbc6 (diff)
downloadchromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.zip
chromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.tar.gz
chromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.tar.bz2
Move implementation from header to source.
This is an effort to speed up compile and link time, and also minimizing the size of the intermediary .o files on disk. For example, just moving the constructor/destructor from the classes in chrome/browser/pref_member.{cc,h} netted a 368k drop in total .o file size. In aggregate, this shrinks libbrowser.a by 10 megabytes, and a few odd megabytes on most other chrome .a files. A lot of this was done before I started harvesting what the most included symbols were across all of chrome's code. Most of them are in webkit, but there's plenty in base/ that are used everywhere to keep me busy for several patches to come. BUG=none TEST=none Review URL: http://codereview.chromium.org/3012001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc16
-rw-r--r--chrome/browser/sessions/tab_restore_service.h8
2 files changed, 21 insertions, 3 deletions
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index 46f1859..720f3ae 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -24,6 +24,10 @@
using base::Time;
+// TimeFactory-----------------------------------------------------------------
+
+TabRestoreService::TimeFactory::~TimeFactory() {}
+
// Entry ----------------------------------------------------------------------
// ID of the next Entry.
@@ -39,6 +43,8 @@ TabRestoreService::Entry::Entry(Type type)
type(type),
from_last_session(false) {}
+TabRestoreService::Entry::~Entry() {}
+
// TabRestoreService ----------------------------------------------------------
// static
@@ -151,9 +157,15 @@ TabRestoreService::Tab::Tab()
pinned(false) {
}
+TabRestoreService::Tab::~Tab() {
+}
+
TabRestoreService::Window::Window() : Entry(WINDOW), selected_tab_index(-1) {
}
+TabRestoreService::Window::~Window() {
+}
+
TabRestoreService::TabRestoreService(Profile* profile,
TabRestoreService::TimeFactory* time_factory)
: BaseSessionService(BaseSessionService::TAB_RESTORE, profile,
@@ -260,6 +272,10 @@ void TabRestoreService::ClearEntries() {
NotifyTabsChanged();
}
+const TabRestoreService::Entries& TabRestoreService::entries() const {
+ return entries_;
+}
+
void TabRestoreService::RestoreMostRecentEntry(Browser* browser) {
if (entries_.empty())
return;
diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h
index bab699a..6b98d15 100644
--- a/chrome/browser/sessions/tab_restore_service.h
+++ b/chrome/browser/sessions/tab_restore_service.h
@@ -48,7 +48,7 @@ class TabRestoreService : public BaseSessionService {
// Interface used to allow the test to provide a custom time.
class TimeFactory {
public:
- virtual ~TimeFactory() {}
+ virtual ~TimeFactory();
virtual base::Time TimeNow() = 0;
};
@@ -61,7 +61,7 @@ class TabRestoreService : public BaseSessionService {
struct Entry {
Entry();
explicit Entry(Type type);
- virtual ~Entry() {}
+ virtual ~Entry();
// Unique id for this entry. The id is guaranteed to be unique for a
// session.
@@ -82,6 +82,7 @@ class TabRestoreService : public BaseSessionService {
// Represents a previously open tab.
struct Tab : public Entry {
Tab();
+ virtual ~Tab();
bool has_browser() const { return browser_id > 0; }
@@ -108,6 +109,7 @@ class TabRestoreService : public BaseSessionService {
// Represents a previously open window.
struct Window : public Entry {
Window();
+ virtual ~Window();
// The tabs that comprised the window, in order.
std::vector<Tab> tabs;
@@ -147,7 +149,7 @@ class TabRestoreService : public BaseSessionService {
// Returns the entries, ordered with most recently closed entries at the
// front.
- virtual const Entries& entries() const { return entries_; }
+ virtual const Entries& entries() const;
// Restores the most recently closed entry. Does nothing if there are no
// entries to restore. If the most recently restored entry is a tab, it is