diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 20:06:30 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 20:06:30 +0000 |
commit | 20f0487a5b73e8071af2612150301b0942cbf0e2 (patch) | |
tree | ecee69b28f16712bdc1558ac0a015ac80095c761 /chrome/browser/history | |
parent | 167b0dd17d5ed57ff293b6480ccaed706e0bc9cb (diff) | |
download | chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.zip chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.gz chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.bz2 |
FBTF: Move ctors/dtors into implementation files. Adds ctors/dtors to non-POD structs.
Cuts ~2MB off our .a files (Debug, Linux). Also added the "virtual" keyword on
a whole bunch of virtual dtors that were missing it.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3522004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r-- | chrome/browser/history/history_types.cc | 35 | ||||
-rw-r--r-- | chrome/browser/history/history_types.h | 16 | ||||
-rw-r--r-- | chrome/browser/history/snippet.cc | 11 | ||||
-rw-r--r-- | chrome/browser/history/snippet.h | 8 |
4 files changed, 61 insertions, 9 deletions
diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc index 8a8ce6d..4591130 100644 --- a/chrome/browser/history/history_types.cc +++ b/chrome/browser/history/history_types.cc @@ -95,6 +95,14 @@ VisitRow::VisitRow(URLID arg_url_id, VisitRow::~VisitRow() { } +// Favicons ------------------------------------------------------------------- + +ImportedFavIconUsage::ImportedFavIconUsage() { +} + +ImportedFavIconUsage::~ImportedFavIconUsage() { +} + // StarredEntry ---------------------------------------------------------------- StarredEntry::StarredEntry() @@ -292,6 +300,33 @@ void QueryResults::AdjustResultMap(size_t begin, size_t end, ptrdiff_t delta) { } } +// QueryOptions ---------------------------------------------------------------- + +QueryOptions::QueryOptions() : max_count(0) {} + +void QueryOptions::SetRecentDayRange(int days_ago) { + end_time = base::Time::Now(); + begin_time = end_time - base::TimeDelta::FromDays(days_ago); +} + +// KeywordSearchTermVisit ----------------------------------------------------- + +KeywordSearchTermVisit::KeywordSearchTermVisit() { +} + +KeywordSearchTermVisit::~KeywordSearchTermVisit() { +} + +// Images --------------------------------------------------------------------- + +Images::Images() { +} + +Images::~Images() { +} + +// HistoryAddPageArgs --------------------------------------------------------- + HistoryAddPageArgs::HistoryAddPageArgs( const GURL& arg_url, base::Time arg_time, diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index 8fab602..b479cbc 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -242,6 +242,9 @@ typedef std::vector<VisitRow> VisitVector; // Used by the importer to set favicons for imported bookmarks. struct ImportedFavIconUsage { + ImportedFavIconUsage(); + ~ImportedFavIconUsage(); + // The URL of the favicon. GURL favicon_url; @@ -479,7 +482,7 @@ class QueryResults { // QueryOptions ---------------------------------------------------------------- struct QueryOptions { - QueryOptions() : max_count(0) {} + QueryOptions(); // The time range to search for matches in. // @@ -497,10 +500,7 @@ struct QueryOptions { base::Time end_time; // Sets the query time to the last |days_ago| days to the present time. - void SetRecentDayRange(int days_ago) { - end_time = base::Time::Now(); - begin_time = end_time - base::TimeDelta::FromDays(days_ago); - } + void SetRecentDayRange(int days_ago); // The maximum number of results to return. The results will be sorted with // the most recent first, so older results may not be returned if there is not @@ -513,6 +513,9 @@ struct QueryOptions { // KeywordSearchTermVisit is returned from GetMostRecentKeywordSearchTerms. It // gives the time and search term of the keyword visit. struct KeywordSearchTermVisit { + KeywordSearchTermVisit(); + ~KeywordSearchTermVisit(); + // The time of the visit. base::Time time; @@ -537,6 +540,9 @@ struct MostVisitedURL { // Used by TopSites to store the thumbnails. struct Images { + Images(); + ~Images(); + scoped_refptr<RefCountedBytes> thumbnail; ThumbnailScore thumbnail_score; diff --git a/chrome/browser/history/snippet.cc b/chrome/browser/history/snippet.cc index 6e3e93c..47c11c3 100644 --- a/chrome/browser/history/snippet.cc +++ b/chrome/browser/history/snippet.cc @@ -200,6 +200,12 @@ void Snippet::ConvertMatchPositionsToWide( } } +Snippet::Snippet() { +} + +Snippet::~Snippet() { +} + void Snippet::ComputeSnippet(const MatchPositions& match_positions, const std::string& document) { // The length of snippets we try to produce. @@ -284,3 +290,8 @@ void Snippet::ComputeSnippet(const MatchPositions& match_positions, utext_close(document_utext); swap(text_, snippet); } + +void Snippet::Swap(Snippet* other) { + text_.swap(other->text_); + matches_.swap(other->matches_); +} diff --git a/chrome/browser/history/snippet.h b/chrome/browser/history/snippet.h index ffa8fa1..bbabef0 100644 --- a/chrome/browser/history/snippet.h +++ b/chrome/browser/history/snippet.h @@ -43,6 +43,9 @@ class Snippet { const std::string& utf8_string, Snippet::MatchPositions* match_positions); + Snippet(); + ~Snippet(); + // Given |matches|, the match positions within |document|, compute the snippet // for the document. // Note that |document| is UTF-8 and the offsets in |matches| are byte @@ -54,10 +57,7 @@ class Snippet { const MatchPositions& matches() const { return matches_; } // Efficiently swaps the contents of this snippet with the other. - void Swap(Snippet* other) { - text_.swap(other->text_); - matches_.swap(other->matches_); - } + void Swap(Snippet* other); private: // The text of the snippet. |