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

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: 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..6c3285c07da01cd856e0d3f1e80b8eac6642e494 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,8 @@ class PersonalDataManagerTest : public testing::Test {
}
virtual void TearDown() {
- personal_data_ = NULL;
- if (profile_.get())
- profile_.reset(NULL);
+ personal_data_.reset(NULL);
+ profile_.reset(NULL);
Ilya Sherman 2011/09/23 03:56:34 nit: Are these calls to reset() really necessary?
dhollowa 2011/09/23 16:30:03 Yes, these are necessary. Destruction order needs
Ilya Sherman 2011/09/23 21:41:38 Ok, in that case, please add a comment noting that
dhollowa 2011/09/23 22:00:58 Done.
GeorgeY 2011/09/23 22:53:27 FYI, the order of the destruction is reverse to or
db_thread_.Stop();
MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask);
@@ -71,7 +69,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 +83,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_;

Powered by Google App Engine
This is Rietveld 408576698