Index: chrome/browser/content_settings/permission_context_base.h |
diff --git a/chrome/browser/content_settings/permission_context_base.h b/chrome/browser/content_settings/permission_context_base.h |
index e72912f00d44ea209346564590cf069a6bacef18..308314ae9310bb595cd0fab08aae0038675412f5 100644 |
--- a/chrome/browser/content_settings/permission_context_base.h |
+++ b/chrome/browser/content_settings/permission_context_base.h |
@@ -63,6 +63,11 @@ class PermissionContextBase : public KeyedService { |
bool user_gesture, |
const BrowserPermissionCallback& callback); |
+ // Withdraw an existing permission request, no op if the permission request |
+ // was already cancelled by some other means. |
+ virtual void CancelPermissionRequest(content::WebContents* web_contents, |
+ const PermissionRequestID& id); |
+ |
protected: |
// Decide whether the permission should be granted. |
// Calls PermissionDecided if permission can be decided non-interactively, |
@@ -98,6 +103,10 @@ class PermissionContextBase : public KeyedService { |
// Return an instance of the infobar queue controller, creating it if needed. |
PermissionQueueController* GetQueueController(); |
+ // KeyedService: |
+ // Called when the associated profile is destroyed. |
+ virtual void Shutdown() OVERRIDE; |
+ |
private: |
void UpdateContentSetting( |
const GURL& requesting_origin, |
@@ -109,10 +118,14 @@ class PermissionContextBase : public KeyedService { |
Profile* profile_; |
const ContentSettingsType permission_type_; |
- base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
scoped_ptr<PermissionQueueController> permission_queue_controller_; |
base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> |
pending_bubbles_; |
+ bool shutting_down_; |
+ |
+ // Must be the last member, to ensure that it will be |
+ // destroyed first, which will invalidate weak pointers |
+ base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
}; |
#endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |