summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 01:55:48 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 01:55:48 +0000
commit7991a2336f3e5b975d5f31ffa24f129eb8bf32ad (patch)
tree52df10a63cfa787c42796566263fcb81c6517d4f /chrome/browser/history
parent6e82c3c6c3860a1005c96f4f6c138aa79a56d685 (diff)
downloadchromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.zip
chromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.tar.gz
chromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.tar.bz2
Seventh patch in making destructors of refcounted objects private.
BUG=26749 Review URL: http://codereview.chromium.org/371006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/history.h11
-rw-r--r--chrome/browser/history/history_backend.cc4
-rw-r--r--chrome/browser/history/history_backend.h5
-rw-r--r--chrome/browser/history/history_marshaling.h4
-rw-r--r--chrome/browser/history/history_unittest.cc3
5 files changed, 21 insertions, 6 deletions
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index 6a886b9..1afe44d 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -59,8 +59,6 @@ class URLDatabase;
// on the main thread.
class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
public:
- virtual ~HistoryDBTask() {}
-
// Invoked on the database thread. The return value indicates whether the
// task is done. A return value of true signals the task is done and
// RunOnDBThread should NOT be invoked again. A return value of false
@@ -73,6 +71,11 @@ class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
// only invoked if the request was not canceled and returned true from
// RunOnDBThread.
virtual void DoneRunOnMainThread() = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<HistoryDBTask>;
+
+ virtual ~HistoryDBTask() {}
};
// The history service records page titles, and visit times, as well as
@@ -95,7 +98,6 @@ class HistoryService : public CancelableRequestProvider,
explicit HistoryService(Profile* profile);
// The empty constructor is provided only for testing.
HistoryService();
- ~HistoryService();
// Initializes the history service, returning true on success. On false, do
// not call any other functions. The given directory will be used for storing
@@ -521,6 +523,7 @@ class HistoryService : public CancelableRequestProvider,
private:
class BackendDelegate;
+ friend class base::RefCountedThreadSafe<HistoryService>;
friend class BackendDelegate;
friend class FaviconService;
friend class history::HistoryBackend;
@@ -534,6 +537,8 @@ class HistoryService : public CancelableRequestProvider,
friend class FavIconRequest;
friend class TestingProfile;
+ ~HistoryService();
+
// These are not currently used, hopefully we can do something in the future
// to ensure that the most important things happen first.
enum SchedulePriority {
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 7b45b22..1a3bd09 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -117,6 +117,10 @@ class CommitLaterTask : public base::RefCounted<CommitLaterTask> {
}
private:
+ friend class base::RefCounted<CommitLaterTask>;
+
+ ~CommitLaterTask() {}
+
scoped_refptr<HistoryBackend> history_backend_;
};
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index 0d854e2..49569f5 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -94,8 +94,6 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
Delegate* delegate,
BookmarkService* bookmark_service);
- ~HistoryBackend();
-
// Must be called after creation but before any objects are created. If this
// fails, all other functions will fail as well. (Since this runs on another
// thread, we don't bother returning failure.)
@@ -274,6 +272,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
#endif
private:
+ friend class base::RefCountedThreadSafe<HistoryBackend>;
friend class CommitLaterTask; // The commit task needs to call Commit().
friend class HistoryTest; // So the unit tests can poke our innards.
FRIEND_TEST(HistoryBackendTest, DeleteAll);
@@ -281,6 +280,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
FRIEND_TEST(HistoryBackendTest, URLsNoLongerBookmarked);
friend class ::TestingProfile;
+ ~HistoryBackend();
+
// Computes the name of the specified database on disk.
FilePath GetThumbnailFileName() const;
FilePath GetArchivedFileName() const;
diff --git a/chrome/browser/history/history_marshaling.h b/chrome/browser/history/history_marshaling.h
index 947f966..d6decb3 100644
--- a/chrome/browser/history/history_marshaling.h
+++ b/chrome/browser/history/history_marshaling.h
@@ -52,6 +52,10 @@ class HistoryAddPageArgs
bool did_replace_entry;
private:
+ friend class base::RefCountedThreadSafe<HistoryAddPageArgs>;
+
+ ~HistoryAddPageArgs() {}
+
DISALLOW_EVIL_CONSTRUCTORS(HistoryAddPageArgs);
};
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index aa9d00f..47cd4e8 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -785,7 +785,6 @@ class HistoryDBTaskImpl : public HistoryDBTask {
static const int kWantInvokeCount;
HistoryDBTaskImpl() : invoke_count(0), done_invoked(false) {}
- virtual ~HistoryDBTaskImpl() {}
virtual bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db) {
return (++invoke_count == kWantInvokeCount);
@@ -800,6 +799,8 @@ class HistoryDBTaskImpl : public HistoryDBTask {
bool done_invoked;
private:
+ virtual ~HistoryDBTaskImpl() {}
+
DISALLOW_EVIL_CONSTRUCTORS(HistoryDBTaskImpl);
};