diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:40:08 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-13 19:40:08 +0000 |
commit | a0835ac1850ccabc846ebfcee537b0b0592b8519 (patch) | |
tree | 6f8911806716dd8011cd0c2b3983722fd751c313 /chrome/browser | |
parent | 51748d266bd3558ec1ee508340cdc9d554ea55f5 (diff) | |
download | chromium_src-a0835ac1850ccabc846ebfcee537b0b0592b8519.zip chromium_src-a0835ac1850ccabc846ebfcee537b0b0592b8519.tar.gz chromium_src-a0835ac1850ccabc846ebfcee537b0b0592b8519.tar.bz2 |
FBTF: Move ctors/dtors into cc files.
This cleanup patch isn't as impactful; this only shrinks our .a files by 304k.
This patch also renames chrome/browser/history/download_type.h to download_create_info.h because there are then two download_type.cc files and MSVS will have the .obj from one of those overwrite the other.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3351005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
30 files changed, 314 insertions, 114 deletions
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc index accc8c6..44ab58e 100644 --- a/chrome/browser/bookmarks/bookmark_drag_data.cc +++ b/chrome/browser/bookmarks/bookmark_drag_data.cc @@ -21,6 +21,9 @@ const char* BookmarkDragData::kClipboardFormatString = "chromium/x-bookmark-entries"; +BookmarkDragData::Element::Element() : is_url(false), id_(0) { +} + BookmarkDragData::Element::Element(const BookmarkNode* node) : is_url(node->is_url()), url(node->GetURL()), @@ -30,6 +33,9 @@ BookmarkDragData::Element::Element(const BookmarkNode* node) children.push_back(Element(node->GetChild(i))); } +BookmarkDragData::Element::~Element() { +} + void BookmarkDragData::Element::WriteToPickle(Pickle* pickle) const { pickle->WriteBool(is_url); pickle->WriteString(url.spec()); @@ -84,6 +90,9 @@ OSExchangeData::CustomFormat BookmarkDragData::GetBookmarkCustomFormat() { } #endif +BookmarkDragData::BookmarkDragData() { +} + BookmarkDragData::BookmarkDragData(const BookmarkNode* node) { elements.push_back(Element(node)); } @@ -93,6 +102,9 @@ BookmarkDragData::BookmarkDragData( ReadFromVector(nodes); } +BookmarkDragData::~BookmarkDragData() { +} + bool BookmarkDragData::ReadFromVector( const std::vector<const BookmarkNode*>& nodes) { Clear(); diff --git a/chrome/browser/bookmarks/bookmark_drag_data.h b/chrome/browser/bookmarks/bookmark_drag_data.h index ca1a10e..d9e52e2f 100644 --- a/chrome/browser/bookmarks/bookmark_drag_data.h +++ b/chrome/browser/bookmarks/bookmark_drag_data.h @@ -44,9 +44,9 @@ class Profile; struct BookmarkDragData { // Element represents a single node. struct Element { + Element(); explicit Element(const BookmarkNode* node); - - Element() : is_url(false), id_(0) {} + ~Element(); // If true, this element represents a URL. bool is_url; @@ -74,7 +74,7 @@ struct BookmarkDragData { int64 id_; }; - BookmarkDragData() { } + BookmarkDragData(); #if defined(TOOLKIT_VIEWS) static OSExchangeData::CustomFormat GetBookmarkCustomFormat(); @@ -84,6 +84,8 @@ struct BookmarkDragData { explicit BookmarkDragData(const BookmarkNode* node); explicit BookmarkDragData(const std::vector<const BookmarkNode*>& nodes); + ~BookmarkDragData(); + // Reads bookmarks from the given vector. bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); diff --git a/chrome/browser/bookmarks/bookmark_editor.cc b/chrome/browser/bookmarks/bookmark_editor.cc new file mode 100644 index 0000000..2e940fc --- /dev/null +++ b/chrome/browser/bookmarks/bookmark_editor.cc @@ -0,0 +1,20 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/bookmarks/bookmark_editor.h" + +#include "googleurl/src/gurl.h" + +BookmarkEditor::EditDetails::EditDetails() + : type(NEW_URL), + existing_node(NULL) { +} + +BookmarkEditor::EditDetails::EditDetails(const BookmarkNode* node) + : type(EXISTING_NODE), + existing_node(node) { +} + +BookmarkEditor::EditDetails::~EditDetails() { +} diff --git a/chrome/browser/bookmarks/bookmark_editor.h b/chrome/browser/bookmarks/bookmark_editor.h index 43e2816..63d3ccf 100644 --- a/chrome/browser/bookmarks/bookmark_editor.h +++ b/chrome/browser/bookmarks/bookmark_editor.h @@ -43,12 +43,9 @@ class BookmarkEditor { NEW_FOLDER }; - EditDetails() : type(NEW_URL), existing_node(NULL) {} - - explicit EditDetails(const BookmarkNode* node) - : type(EXISTING_NODE), - existing_node(node) { - } + EditDetails(); + explicit EditDetails(const BookmarkNode* node); + ~EditDetails(); // See description of enum value for details. Type type; diff --git a/chrome/browser/bookmarks/bookmark_index.cc b/chrome/browser/bookmarks/bookmark_index.cc index 359fc3a..b1c1ab3 100644 --- a/chrome/browser/bookmarks/bookmark_index.cc +++ b/chrome/browser/bookmarks/bookmark_index.cc @@ -6,6 +6,7 @@ #include <algorithm> #include <iterator> +#include <list> #include "app/l10n_util.h" #include "base/string16.h" @@ -15,6 +16,31 @@ #include "chrome/browser/history/query_parser.h" #include "chrome/browser/profile.h" +// Used when finding the set of bookmarks that match a query. Each match +// represents a set of terms (as an interator into the Index) matching the +// query as well as the set of nodes that contain those terms in their titles. +struct BookmarkIndex::Match { + // List of terms matching the query. + std::list<Index::const_iterator> terms; + + // The set of nodes matching the terms. As an optimization this is empty + // when we match only one term, and is filled in when we get more than one + // term. We can do this as when we have only one matching term we know + // the set of matching nodes is terms.front()->second. + // + // Use nodes_begin() and nodes_end() to get an iterator over the set as + // it handles the necessary switching between nodes and terms.front(). + NodeSet nodes; + + // Returns an iterator to the beginning of the matching nodes. See + // description of nodes for why this should be used over nodes.begin(). + NodeSet::const_iterator nodes_begin() const; + + // Returns an iterator to the beginning of the matching nodes. See + // description of nodes for why this should be used over nodes.end(). + NodeSet::const_iterator nodes_end() const; +}; + BookmarkIndex::NodeSet::const_iterator BookmarkIndex::Match::nodes_begin() const { return nodes.empty() ? terms.front()->second.begin() : nodes.begin(); @@ -24,6 +50,12 @@ BookmarkIndex::NodeSet::const_iterator BookmarkIndex::Match::nodes_end() const { return nodes.empty() ? terms.front()->second.end() : nodes.end(); } +BookmarkIndex::BookmarkIndex(Profile* profile) : profile_(profile) { +} + +BookmarkIndex::~BookmarkIndex() { +} + void BookmarkIndex::Add(const BookmarkNode* node) { if (!node->is_url()) return; diff --git a/chrome/browser/bookmarks/bookmark_index.h b/chrome/browser/bookmarks/bookmark_index.h index ac8e207..d6ea15a 100644 --- a/chrome/browser/bookmarks/bookmark_index.h +++ b/chrome/browser/bookmarks/bookmark_index.h @@ -6,7 +6,6 @@ #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_INDEX_H_ #pragma once -#include <list> #include <map> #include <set> #include <vector> @@ -37,7 +36,8 @@ class URLDatabase; class BookmarkIndex { public: - explicit BookmarkIndex(Profile* profile) : profile_(profile) {} + explicit BookmarkIndex(Profile* profile); + ~BookmarkIndex(); // Invoked when a bookmark has been added to the model. void Add(const BookmarkNode* node); @@ -55,31 +55,7 @@ class BookmarkIndex { typedef std::set<const BookmarkNode*> NodeSet; typedef std::map<string16, NodeSet> Index; - // Used when finding the set of bookmarks that match a query. Each match - // represents a set of terms (as an interator into the Index) matching the - // query as well as the set of nodes that contain those terms in their titles. - struct Match { - // List of terms matching the query. - std::list<Index::const_iterator> terms; - - // The set of nodes matching the terms. As an optimization this is empty - // when we match only one term, and is filled in when we get more than one - // term. We can do this as when we have only one matching term we know - // the set of matching nodes is terms.front()->second. - // - // Use nodes_begin() and nodes_end() to get an iterator over the set as - // it handles the necessary switching between nodes and terms.front(). - NodeSet nodes; - - // Returns an iterator to the beginning of the matching nodes. See - // description of nodes for why this should be used over nodes.begin(). - NodeSet::const_iterator nodes_begin() const; - - // Returns an iterator to the beginning of the matching nodes. See - // description of nodes for why this should be used over nodes.end(). - NodeSet::const_iterator nodes_end() const; - }; - + struct Match; typedef std::vector<Match> Matches; // Pairs BookmarkNodes and the number of times the nodes' URLs were typed. diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 288c4a8..606c205 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -43,6 +43,9 @@ BookmarkNode::BookmarkNode(int64 id, const GURL& url) Initialize(id); } +BookmarkNode::~BookmarkNode() { +} + void BookmarkNode::Initialize(int64 id) { id_ = id; loaded_favicon_ = false; diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index e56c58d..015de94 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -56,7 +56,7 @@ class BookmarkNode : public TreeNode<BookmarkNode> { explicit BookmarkNode(const GURL& url); // Creates a new node with the specified url and id. BookmarkNode(int64 id, const GURL& url); - virtual ~BookmarkNode() {} + virtual ~BookmarkNode(); // Returns the URL. const GURL& GetURL() const { return url_; } diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc index 365ba37..6cfe003 100644 --- a/chrome/browser/bookmarks/bookmark_storage.cc +++ b/chrome/browser/bookmarks/bookmark_storage.cc @@ -125,6 +125,22 @@ class BookmarkStorage::LoadTask : public Task { DISALLOW_COPY_AND_ASSIGN(LoadTask); }; +// BookmarkLoadDetails --------------------------------------------------------- + +BookmarkLoadDetails::BookmarkLoadDetails(BookmarkNode* bb_node, + BookmarkNode* other_folder_node, + BookmarkIndex* index, + int64 max_id) + : bb_node_(bb_node), + other_folder_node_(other_folder_node), + index_(index), + max_id_(max_id), + ids_reassigned_(false) { +} + +BookmarkLoadDetails::~BookmarkLoadDetails() { +} + // BookmarkStorage ------------------------------------------------------------- BookmarkStorage::BookmarkStorage(Profile* profile, BookmarkModel* model) diff --git a/chrome/browser/bookmarks/bookmark_storage.h b/chrome/browser/bookmarks/bookmark_storage.h index 6b06957..541b063 100644 --- a/chrome/browser/bookmarks/bookmark_storage.h +++ b/chrome/browser/bookmarks/bookmark_storage.h @@ -31,13 +31,8 @@ class BookmarkLoadDetails { BookmarkLoadDetails(BookmarkNode* bb_node, BookmarkNode* other_folder_node, BookmarkIndex* index, - int64 max_id) - : bb_node_(bb_node), - other_folder_node_(other_folder_node), - index_(index), - max_id_(max_id), - ids_reassigned_(false) { - } + int64 max_id); + ~BookmarkLoadDetails(); BookmarkNode* bb_node() { return bb_node_.get(); } BookmarkNode* release_bb_node() { return bb_node_.release(); } diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index ab56380..495228d 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -8,7 +8,7 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" DownloadFile::DownloadFile(const DownloadCreateInfo* info, DownloadManager* download_manager) diff --git a/chrome/browser/download/download_file_manager.cc b/chrome/browser/download/download_file_manager.cc index b66d1f8..bbeb10a 100644 --- a/chrome/browser/download/download_file_manager.cc +++ b/chrome/browser/download/download_file_manager.cc @@ -12,7 +12,7 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc index 26b65c4..9c86708 100644 --- a/chrome/browser/download/download_history.cc +++ b/chrome/browser/download/download_history.cc @@ -5,7 +5,7 @@ #include "chrome/browser/download/download_history.h" #include "base/logging.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/history/history_marshaling.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc index 8ba789c..787b8ad 100644 --- a/chrome/browser/download/download_item.cc +++ b/chrome/browser/download/download_item.cc @@ -15,7 +15,7 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index d44bd38..16820a2 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -26,7 +26,7 @@ #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_util.h" #include "chrome/browser/extensions/extensions_service.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc index 913ad76..ded2494 100644 --- a/chrome/browser/download/download_manager_unittest.cc +++ b/chrome/browser/download/download_manager_unittest.cc @@ -12,7 +12,7 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_util.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/pref_names.h" #include "chrome/test/testing_profile.h" diff --git a/chrome/browser/download/download_types.cc b/chrome/browser/download/download_types.cc new file mode 100644 index 0000000..543555c --- /dev/null +++ b/chrome/browser/download/download_types.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/download/download_types.h" + +DownloadBuffer::DownloadBuffer() { +} + +DownloadBuffer::~DownloadBuffer() { +} + +DownloadSaveInfo::DownloadSaveInfo() { +} + +DownloadSaveInfo::DownloadSaveInfo(const DownloadSaveInfo& info) + : file_path(info.file_path), + file_stream(info.file_stream) { +} + +DownloadSaveInfo::~DownloadSaveInfo() { +} + +DownloadSaveInfo& DownloadSaveInfo::operator=(const DownloadSaveInfo& info) { + file_path = info.file_path; + file_stream = info.file_stream; + return *this; +} diff --git a/chrome/browser/download/download_types.h b/chrome/browser/download/download_types.h index 94dd147..bf3a9c7 100644 --- a/chrome/browser/download/download_types.h +++ b/chrome/browser/download/download_types.h @@ -24,6 +24,9 @@ class IOBuffer; // is synchronized via the lock. Each entry in 'contents' represents one data // buffer and its size in bytes. struct DownloadBuffer { + DownloadBuffer(); + ~DownloadBuffer(); + Lock lock; typedef std::pair<net::IOBuffer*, int> Contents; std::vector<Contents> contents; @@ -31,6 +34,11 @@ struct DownloadBuffer { // Holds the information about how to save a download file. struct DownloadSaveInfo { + DownloadSaveInfo(); + DownloadSaveInfo(const DownloadSaveInfo& info); + ~DownloadSaveInfo(); + DownloadSaveInfo& operator=(const DownloadSaveInfo& info); + FilePath file_path; linked_ptr<net::FileStream> file_stream; }; diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 161758f..5747e51 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -33,7 +33,7 @@ #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_install_ui.h" #include "chrome/browser/extensions/extensions_service.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" diff --git a/chrome/browser/history/download_create_info.cc b/chrome/browser/history/download_create_info.cc new file mode 100644 index 0000000..955caed --- /dev/null +++ b/chrome/browser/history/download_create_info.cc @@ -0,0 +1,47 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/history/download_create_info.h" + +DownloadCreateInfo::DownloadCreateInfo(const FilePath& path, + const GURL& url, + base::Time start_time, + int64 received_bytes, + int64 total_bytes, + int32 state, + int32 download_id) + : path(path), + url(url), + path_uniquifier(0), + start_time(start_time), + received_bytes(received_bytes), + total_bytes(total_bytes), + state(state), + download_id(download_id), + child_id(-1), + render_view_id(-1), + request_id(-1), + db_handle(0), + prompt_user_for_save_location(false), + is_dangerous(false), + is_extension_install(false) { +} + +DownloadCreateInfo::DownloadCreateInfo() + : path_uniquifier(0), + received_bytes(0), + total_bytes(0), + state(-1), + download_id(-1), + child_id(-1), + render_view_id(-1), + request_id(-1), + db_handle(0), + prompt_user_for_save_location(false), + is_dangerous(false), + is_extension_install(false) { +} + +DownloadCreateInfo::~DownloadCreateInfo() { +} diff --git a/chrome/browser/history/download_types.h b/chrome/browser/history/download_create_info.h index 1c21b47..fc207f4 100644 --- a/chrome/browser/history/download_types.h +++ b/chrome/browser/history/download_create_info.h @@ -4,8 +4,8 @@ // // Download creation struct used for querying the history service. -#ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ -#define CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ +#ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ +#define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ #pragma once #include <string> @@ -27,38 +27,9 @@ struct DownloadCreateInfo { int64 received_bytes, int64 total_bytes, int32 state, - int32 download_id) - : path(path), - url(url), - path_uniquifier(0), - start_time(start_time), - received_bytes(received_bytes), - total_bytes(total_bytes), - state(state), - download_id(download_id), - child_id(-1), - render_view_id(-1), - request_id(-1), - db_handle(0), - prompt_user_for_save_location(false), - is_dangerous(false), - is_extension_install(false) { - } - - DownloadCreateInfo() - : path_uniquifier(0), - received_bytes(0), - total_bytes(0), - state(-1), - download_id(-1), - child_id(-1), - render_view_id(-1), - request_id(-1), - db_handle(0), - prompt_user_for_save_location(false), - is_dangerous(false), - is_extension_install(false) { - } + int32 download_id); + DownloadCreateInfo(); + ~DownloadCreateInfo(); // DownloadItem fields FilePath path; diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc index e985cca..f101e39 100644 --- a/chrome/browser/history/download_database.cc +++ b/chrome/browser/history/download_database.cc @@ -12,7 +12,7 @@ #include "base/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/download/download_item.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" // Download schema: // diff --git a/chrome/browser/history/download_types.cc b/chrome/browser/history/download_types.cc new file mode 100644 index 0000000..c0efd01 --- /dev/null +++ b/chrome/browser/history/download_types.cc @@ -0,0 +1,47 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/history/download_types.h" + +DownloadCreateInfo::DownloadCreateInfo(const FilePath& path, + const GURL& url, + base::Time start_time, + int64 received_bytes, + int64 total_bytes, + int32 state, + int32 download_id) + : path(path), + url(url), + path_uniquifier(0), + start_time(start_time), + received_bytes(received_bytes), + total_bytes(total_bytes), + state(state), + download_id(download_id), + child_id(-1), + render_view_id(-1), + request_id(-1), + db_handle(0), + prompt_user_for_save_location(false), + is_dangerous(false), + is_extension_install(false) { +} + +DownloadCreateInfo::DownloadCreateInfo() + : path_uniquifier(0), + received_bytes(0), + total_bytes(0), + state(-1), + download_id(-1), + child_id(-1), + render_view_id(-1), + request_id(-1), + db_handle(0), + prompt_user_for_save_location(false), + is_dangerous(false), + is_extension_install(false) { +} + +DownloadCreateInfo::~DownloadCreateInfo() { +} diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index fb08fa0..e0c63b3 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -35,7 +35,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/chrome_thread.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/history/history_backend.h" #include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/history_types.h" diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index db49bfb..027c559 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -17,7 +17,7 @@ #include "base/time.h" #include "chrome/browser/autocomplete/history_url_provider.h" #include "chrome/browser/bookmarks/bookmark_service.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/history/history_notifications.h" #include "chrome/browser/history/history_publisher.h" #include "chrome/browser/history/in_memory_history_backend.h" diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index 96cad61..f3e76cf 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -12,7 +12,6 @@ #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" #include "chrome/browser/history/archived_database.h" -#include "chrome/browser/history/download_types.h" #include "chrome/browser/history/expire_history_backend.h" #include "chrome/browser/history/history_database.h" #include "chrome/browser/history/history_marshaling.h" @@ -24,6 +23,7 @@ #include "chrome/common/mru_cache.h" class BookmarkService; +struct DownloadCreateInfo; class TestingProfile; struct ThumbnailScore; diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc index 4f67beb..8a8ce6d 100644 --- a/chrome/browser/history/history_types.cc +++ b/chrome/browser/history/history_types.cc @@ -16,6 +16,37 @@ namespace history { // URLRow ---------------------------------------------------------------------- +URLRow::URLRow() { + Initialize(); +} + +URLRow::URLRow(const GURL& url) : url_(url) { + // Initialize will not set the URL, so our initialization above will stay. + Initialize(); +} + +URLRow::URLRow(const GURL& url, URLID id) : url_(url) { + // Initialize will not set the URL, so our initialization above will stay. + Initialize(); + // Initialize will zero the id_, so set it here. + id_ = id; +} + +URLRow::~URLRow() { +} + +URLRow& URLRow::operator=(const URLRow& other) { + id_ = other.id_; + url_ = other.url_; + title_ = other.title_; + visit_count_ = other.visit_count_; + typed_count_ = other.typed_count_; + last_visit_ = other.last_visit_; + hidden_ = other.hidden_; + favicon_id_ = other.favicon_id_; + return *this; +} + void URLRow::Swap(URLRow* other) { std::swap(id_, other->id_); url_.Swap(&other->url_); @@ -61,6 +92,9 @@ VisitRow::VisitRow(URLID arg_url_id, is_indexed(false) { } +VisitRow::~VisitRow() { +} + // StarredEntry ---------------------------------------------------------------- StarredEntry::StarredEntry() @@ -72,6 +106,9 @@ StarredEntry::StarredEntry() url_id(0) { } +StarredEntry::~StarredEntry() { +} + void StarredEntry::Swap(StarredEntry* other) { std::swap(id, other->id); title.swap(other->title); @@ -87,6 +124,23 @@ void StarredEntry::Swap(StarredEntry* other) { // URLResult ------------------------------------------------------------------- +URLResult::URLResult() { +} + +URLResult::URLResult(const GURL& url, base::Time visit_time) + : URLRow(url), + visit_time_(visit_time) { +} + +URLResult::URLResult(const GURL& url, + const Snippet::MatchPositions& title_matches) + : URLRow(url) { + title_match_positions_ = title_matches; +} + +URLResult::~URLResult() { +} + void URLResult::Swap(URLResult* other) { URLRow::Swap(other); std::swap(visit_time_, other->visit_time_); @@ -259,6 +313,9 @@ HistoryAddPageArgs::HistoryAddPageArgs( did_replace_entry(arg_did_replace_entry) { } +HistoryAddPageArgs::~HistoryAddPageArgs() { +} + HistoryAddPageArgs* HistoryAddPageArgs::Clone() const { return new HistoryAddPageArgs( url, time, id_scope, page_id, referrer, redirects, transition, diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index 6c10bfc..8fab602 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -60,25 +60,16 @@ typedef int64 URLID; // dirty bits will not be in sync for these copies. class URLRow { public: - URLRow() { - Initialize(); - } + URLRow(); - explicit URLRow(const GURL& url) : url_(url) { - // Initialize will not set the URL, so our initialization above will stay. - Initialize(); - } + explicit URLRow(const GURL& url); // We need to be able to set the id of a URLRow that's being passed through // an IPC message. This constructor should probably not be used otherwise. - URLRow(const GURL& url, URLID id) : url_(url) { - // Initialize will not set the URL, so our initialization above will stay. - Initialize(); - // Initialize will zero the id_, so set it here. - id_ = id; - } + URLRow(const GURL& url, URLID id); - virtual ~URLRow() {} + virtual ~URLRow(); + URLRow& operator=(const URLRow& other); URLID id() const { return id_; } const GURL& url() const { return url_; } @@ -208,6 +199,7 @@ class VisitRow { VisitID arg_referring_visit, PageTransition::Type arg_transition, SegmentID arg_segment_id); + ~VisitRow(); // ID of this row (visit ID, used a a referrer for other visits). VisitID visit_id; @@ -299,6 +291,7 @@ struct StarredEntry { }; StarredEntry(); + ~StarredEntry(); void Swap(StarredEntry* other); @@ -343,17 +336,12 @@ struct StarredEntry { class URLResult : public URLRow { public: - URLResult() {} - URLResult(const GURL& url, base::Time visit_time) - : URLRow(url), - visit_time_(visit_time) { - } + URLResult(); + URLResult(const GURL& url, base::Time visit_time); // Constructor that create a URLResult from the specified URL and title match // positions from title_matches. - URLResult(const GURL& url, const Snippet::MatchPositions& title_matches) - : URLRow(url) { - title_match_positions_ = title_matches; - } + URLResult(const GURL& url, const Snippet::MatchPositions& title_matches); + ~URLResult(); base::Time visit_time() const { return visit_time_; } void set_visit_time(base::Time visit_time) { visit_time_ = visit_time; } @@ -593,7 +581,7 @@ class HistoryAddPageArgs private: friend class base::RefCountedThreadSafe<HistoryAddPageArgs>; - ~HistoryAddPageArgs() {} + ~HistoryAddPageArgs(); DISALLOW_COPY_AND_ASSIGN(HistoryAddPageArgs); }; diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 94e4d9e..37e95dff 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -35,6 +35,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_item.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/history/history.h" #include "chrome/browser/history/history_backend.h" #include "chrome/browser/history/history_database.h" diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc index 8b32948..abedce3 100644 --- a/chrome/browser/renderer_host/download_resource_handler.cc +++ b/chrome/browser/renderer_host/download_resource_handler.cc @@ -8,7 +8,7 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/download/download_file_manager.h" -#include "chrome/browser/history/download_types.h" +#include "chrome/browser/history/download_create_info.h" #include "chrome/browser/renderer_host/global_request_id.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/common/resource_response.h" |