Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4128)

Unified Diff: chrome/browser/autofill/personal_data_manager_unittest.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses isherman #11 Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/personal_data_manager_unittest.cc
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc
index 2a7d20f6048c8472d8b4902611d0e10670d15362..fb4a5585c33b6025d5b8d768439a44a2d85da346 100644
--- a/chrome/browser/autofill/personal_data_manager_unittest.cc
+++ b/chrome/browser/autofill/personal_data_manager_unittest.cc
@@ -5,7 +5,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
@@ -61,9 +60,9 @@ class PersonalDataManagerTest : public testing::Test {
}
virtual void TearDown() {
- personal_data_ = NULL;
- if (profile_.get())
- profile_.reset(NULL);
+ // Destruction order is imposed explicitly here.
+ personal_data_.reset(NULL);
+ profile_.reset(NULL);
db_thread_.Stop();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask);
@@ -71,7 +70,7 @@ class PersonalDataManagerTest : public testing::Test {
}
void ResetPersonalDataManager() {
- personal_data_ = new PersonalDataManager();
+ personal_data_.reset(new PersonalDataManager);
personal_data_->Init(profile_.get());
personal_data_->SetObserver(&personal_data_observer_);
@@ -85,7 +84,7 @@ class PersonalDataManagerTest : public testing::Test {
BrowserThread ui_thread_;
BrowserThread db_thread_;
scoped_ptr<TestingProfile> profile_;
- scoped_refptr<PersonalDataManager> personal_data_;
+ scoped_ptr<PersonalDataManager> personal_data_;
NotificationRegistrar registrar_;
NotificationObserverMock observer_;
PersonalDataLoadedObserverMock personal_data_observer_;
« no previous file with comments | « chrome/browser/autofill/personal_data_manager_factory.cc ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698