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

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: apply review feedback 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..822e2d8913ccd65b8646fac07deb7b58e0badd0b 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),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
+}
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));
« no previous file with comments | « chrome/browser/chromeos/contacts/contact_manager_stub.h ('k') | chrome/browser/chromeos/contacts/google_contact_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698