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

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

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.h
diff --git a/chrome/browser/chromeos/contacts/contact_manager_stub.h b/chrome/browser/chromeos/contacts/contact_manager_stub.h
index 817d64db0f81efda4a21118244076caf58333230..340374073b20be56799c63013f88e5f22bb14bd9 100644
--- a/chrome/browser/chromeos/contacts/contact_manager_stub.h
+++ b/chrome/browser/chromeos/contacts/contact_manager_stub.h
@@ -25,6 +25,7 @@ class ContactManagerStub : public ContactManagerInterface {
void NotifyObserversAboutUpdatedContacts();
// ContactManagerInterface overrides:
+ virtual base::WeakPtr<ContactManagerInterface> GetWeakPtr() OVERRIDE;
virtual void AddObserver(ContactManagerObserver* observer, Profile* profile)
OVERRIDE;
virtual void RemoveObserver(ContactManagerObserver* observer,
@@ -44,6 +45,10 @@ class ContactManagerStub : public ContactManagerInterface {
// Contacts that will be returned by GetAllContacts() and GetContactById().
ScopedVector<Contact> contacts_;
+ // Note: This should remain the last member so it'll be destroyed and
+ // invalidate its weak pointers before any other members are destroyed.
+ base::WeakPtrFactory<ContactManagerInterface> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ContactManagerStub);
};
« no previous file with comments | « chrome/browser/chromeos/contacts/contact_manager.cc ('k') | chrome/browser/chromeos/contacts/contact_manager_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698