summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-13 19:40:08 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-13 19:40:08 +0000
commita0835ac1850ccabc846ebfcee537b0b0592b8519 (patch)
tree6f8911806716dd8011cd0c2b3983722fd751c313 /chrome/browser/history
parent51748d266bd3558ec1ee508340cdc9d554ea55f5 (diff)
downloadchromium_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/history')
-rw-r--r--chrome/browser/history/download_create_info.cc47
-rw-r--r--chrome/browser/history/download_create_info.h (renamed from chrome/browser/history/download_types.h)39
-rw-r--r--chrome/browser/history/download_database.cc2
-rw-r--r--chrome/browser/history/download_types.cc47
-rw-r--r--chrome/browser/history/history.cc2
-rw-r--r--chrome/browser/history/history_backend.cc2
-rw-r--r--chrome/browser/history/history_backend.h2
-rw-r--r--chrome/browser/history/history_types.cc57
-rw-r--r--chrome/browser/history/history_types.h36
-rw-r--r--chrome/browser/history/history_unittest.cc1
10 files changed, 173 insertions, 62 deletions
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"