Index: chrome/browser/policy/cloud/user_cloud_policy_invalidator.h |
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_invalidator.h b/chrome/browser/policy/cloud/user_cloud_policy_invalidator.h |
index 96988c1a63ec42ca27ef8c8248bcd4be4da8bd3e..992ebfdb1fd4c69b1f332058dd37ad3e77f9c92d 100644 |
--- a/chrome/browser/policy/cloud/user_cloud_policy_invalidator.h |
+++ b/chrome/browser/policy/cloud/user_cloud_policy_invalidator.h |
@@ -5,6 +5,7 @@ |
#ifndef CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_INVALIDATOR_H_ |
#define CHROME_BROWSER_POLICY_CLOUD_USER_CLOUD_POLICY_INVALIDATOR_H_ |
+#include "base/memory/weak_ptr.h" |
#include "chrome/browser/policy/cloud/cloud_policy_invalidator.h" |
#include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
#include "content/public/browser/notification_observer.h" |
@@ -31,6 +32,8 @@ class UserCloudPolicyInvalidator : public CloudPolicyInvalidator, |
Profile* profile, |
CloudPolicyManager* policy_manager); |
+ virtual ~UserCloudPolicyInvalidator(); |
+ |
// BrowserContextKeyedService: |
virtual void Shutdown() OVERRIDE; |
@@ -40,15 +43,16 @@ class UserCloudPolicyInvalidator : public CloudPolicyInvalidator, |
const content::NotificationDetails& details) OVERRIDE; |
private: |
- // The profile associated with the invalidator. |
- Profile* profile_; |
- |
// The policy manager for the user policy. |
CloudPolicyManager* policy_manager_; |
// Used to register for notification that profile creation is complete. |
content::NotificationRegistrar registrar_; |
+ // WeakPtrFactory used to create a reference to this object used by the |
+ // policy manager. |
+ base::WeakPtrFactory<CloudPolicyInvalidator> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyInvalidator); |
}; |