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

Unified Diff: content/browser/indexed_db/indexed_db_database.cc

Issue 2386683003: IndexedDB: Ignore open/delete requests from terminated renderers. (Closed)
Patch Set: Created 4 years, 3 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/indexed_db/indexed_db_database.cc
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index c25f47e32d7f26dc9a0ca196482eaeb4075f5369..d4952ae170d446e2709f2725c69dbc19220be357 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -118,6 +118,11 @@ class IndexedDBDatabase::OpenRequest
: ConnectionRequest(db), pending_(std::move(pending_connection)) {}
void Perform() override {
+ if (!pending_->callbacks->IsValid()) {
+ db_->RequestComplete(this);
+ return;
+ }
+
if (db_->metadata_.id == kInvalidId) {
// The database was deleted then immediately re-opened; OpenInternal()
// recreates it in the backing store.
@@ -290,6 +295,11 @@ class IndexedDBDatabase::DeleteRequest
: ConnectionRequest(db), callbacks_(callbacks) {}
void Perform() override {
+ if (!callbacks_->IsValid()) {
cmumford 2016/10/03 18:39:26 I can see completing the open if disconnecting, bu
jsbell 2016/10/03 19:28:37 Could go either way, yeah. I decided this way for
cmumford 2016/10/03 20:03:34 My main worry is that a normal (i.e. not-crash) sh
jsbell 2016/10/03 20:57:58 That's a very good point, I hadn't considered that
+ db_->RequestComplete(this);
+ return;
+ }
+
if (db_->connections_.empty()) {
// No connections, so delete immediately.
DoDelete();

Powered by Google App Engine
This is Rietveld 408576698