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

Unified Diff: chrome/browser/chromeos/contacts/contact_manager_stub.cc

Issue 10896031: contacts: Add ContactManagerInterface::GetWeakPtr(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update a comment Created 8 years, 4 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/chromeos/contacts/contact_manager_stub.cc
diff --git a/chrome/browser/chromeos/contacts/contact_manager_stub.cc b/chrome/browser/chromeos/contacts/contact_manager_stub.cc
index fd5a86bfb153816321bfae5d3c33ec6d3fd20e70..0ce8248a0ccc54bd2c99c4730715036f4de1fd3a 100644
--- a/chrome/browser/chromeos/contacts/contact_manager_stub.cc
+++ b/chrome/browser/chromeos/contacts/contact_manager_stub.cc
@@ -16,7 +16,10 @@ using content::BrowserThread;
namespace contacts {
-ContactManagerStub::ContactManagerStub(Profile* profile) : profile_(profile) {}
+ContactManagerStub::ContactManagerStub(Profile* profile)
+ : profile_(profile),
+ weak_ptr_factory_(this) {
satorux1 2012/08/30 17:19:26 ALLOW_THIS_IN_INITIALIZER_LIST ?
Daniel Erat 2012/08/30 20:59:45 Done.
+}
ContactManagerStub::~ContactManagerStub() {}
@@ -30,6 +33,11 @@ void ContactManagerStub::SetContacts(const ContactPointers& contacts) {
test::CopyContacts(contacts, &contacts_);
}
+base::WeakPtr<ContactManagerInterface> ContactManagerStub::GetWeakPtr() {
+ CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return weak_ptr_factory_.GetWeakPtr();
+}
+
void ContactManagerStub::AddObserver(ContactManagerObserver* observer,
Profile* profile) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

Powered by Google App Engine
This is Rietveld 408576698