From a5894febf1f091bb122ae6273fd49f26dba5f0aa Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Thu, 1 Nov 2012 14:40:56 +0000 Subject: 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 --- chrome/browser/visitedlink/visitedlink_unittest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/visitedlink') 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 master_; - scoped_refptr history_service_; + scoped_ptr history_service_; TrackingVisitedLinkEventListener listener_; }; -- cgit v1.1