summaryrefslogtreecommitdiffstats
path: root/chrome/browser/visitedlink
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 14:40:56 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 14:40:56 +0000
commita5894febf1f091bb122ae6273fd49f26dba5f0aa (patch)
treeceeb84bc784a00a68e465663d151d04df5f8c1c5 /chrome/browser/visitedlink
parent32f72e6f11a2a9a65ef50a674b838c66ee2c677d (diff)
downloadchromium_src-a5894febf1f091bb122ae6273fd49f26dba5f0aa.zip
chromium_src-a5894febf1f091bb122ae6273fd49f26dba5f0aa.tar.gz
chromium_src-a5894febf1f091bb122ae6273fd49f26dba5f0aa.tar.bz2
Make history service not ref-counted and not thread-safe
This is in preparation for making it handle delete directives. Make HistoryService use a ThreadChecker. Make VisitDataObserver list a non-thread-safe observer list. Make HistoryService vend WeakPtrs for sync. Make PrerenderLocalPredictor not keep a pointer to the HistoryService. Make sync trampoline to the UI thread when posting tasks on the history thread. BUG=141245 Review URL: https://chromiumcodereview.appspot.com/11229049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/visitedlink')
-rw-r--r--chrome/browser/visitedlink/visitedlink_unittest.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/visitedlink/visitedlink_unittest.cc b/chrome/browser/visitedlink/visitedlink_unittest.cc
index 4056110..bfff076 100644
--- a/chrome/browser/visitedlink/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink/visitedlink_unittest.cc
@@ -93,7 +93,7 @@ class VisitedLinkTest : public testing::Test {
file_thread_(BrowserThread::FILE, &message_loop_) {}
// Initialize the history system. This should be called before InitVisited().
bool InitHistory() {
- history_service_ = new HistoryService;
+ history_service_.reset(new HistoryService);
return history_service_->Init(history_dir_, NULL);
}
@@ -104,7 +104,7 @@ class VisitedLinkTest : public testing::Test {
// the VisitedLinkMaster constructor.
bool InitVisited(int initial_size, bool suppress_rebuild) {
// Initialize the visited link system.
- master_.reset(new VisitedLinkMaster(&listener_, history_service_,
+ master_.reset(new VisitedLinkMaster(&listener_, history_service_.get(),
suppress_rebuild, visited_file_,
initial_size));
return master_->Init();
@@ -119,7 +119,7 @@ class VisitedLinkTest : public testing::Test {
if (history_service_.get()) {
history_service_->SetOnBackendDestroyTask(MessageLoop::QuitClosure());
history_service_->Cleanup();
- history_service_ = NULL;
+ history_service_.reset();
// Wait for the backend class to terminate before deleting the files and
// moving to the next test. Note: if this never terminates, somebody is
@@ -202,7 +202,7 @@ class VisitedLinkTest : public testing::Test {
FilePath visited_file_;
scoped_ptr<VisitedLinkMaster> master_;
- scoped_refptr<HistoryService> history_service_;
+ scoped_ptr<HistoryService> history_service_;
TrackingVisitedLinkEventListener listener_;
};