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

Unified Diff: content/browser/notifications/platform_notification_context_impl.h

Issue 1024463006: Destroy the notification database when corruption occurs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-SWContextObserver
Patch Set: Created 5 years, 9 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: content/browser/notifications/platform_notification_context_impl.h
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index ddbf2a7169130cf33f940a7f44a87733def37b5d..c84d02950986f7d96939cf923d143a0bff4dd100 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -58,6 +58,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// ServiceWorkerContextObserver implementation.
void OnRegistrationDeleted(int64_t registration_id,
const GURL& pattern) override;
+ void OnStorageWiped() override;
private:
friend class PlatformNotificationContextTest;
@@ -78,7 +79,8 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// database has been opened, |success_closure| will be invoked on the task
// thread, otherwise |failure_closure_| will be invoked on the IO thread.
void OpenDatabase(const base::Closure& success_closure,
- const base::Closure& failure_closure);
+ const base::Closure& failure_closure,
+ bool delete_on_corruption);
// Deletes all notifications associated with |service_worker_registration_id|
// belonging to |origin|. Must be called on the |task_runner_| thread.
@@ -107,6 +109,10 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
const GURL& origin,
const DeleteResultCallback& callback);
+ // Destroys the database regardless of its initialization status. This method
+ // must only be called on the |task_runner_| thread.
+ void DestroyDatabase();
+
// Returns the path in which the database should be initialized. May be empty.
base::FilePath GetDatabasePath() const;

Powered by Google App Engine
This is Rietveld 408576698