OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/indexed_db/indexed_db_database.h" | 5 #include "content/browser/indexed_db/indexed_db_database.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 }; | 111 }; |
112 | 112 |
113 class IndexedDBDatabase::OpenRequest | 113 class IndexedDBDatabase::OpenRequest |
114 : public IndexedDBDatabase::ConnectionRequest { | 114 : public IndexedDBDatabase::ConnectionRequest { |
115 public: | 115 public: |
116 OpenRequest(scoped_refptr<IndexedDBDatabase> db, | 116 OpenRequest(scoped_refptr<IndexedDBDatabase> db, |
117 std::unique_ptr<IndexedDBPendingConnection> pending_connection) | 117 std::unique_ptr<IndexedDBPendingConnection> pending_connection) |
118 : ConnectionRequest(db), pending_(std::move(pending_connection)) {} | 118 : ConnectionRequest(db), pending_(std::move(pending_connection)) {} |
119 | 119 |
120 void Perform() override { | 120 void Perform() override { |
| 121 if (!pending_->callbacks->IsValid()) { |
| 122 db_->RequestComplete(this); |
| 123 return; |
| 124 } |
| 125 |
121 if (db_->metadata_.id == kInvalidId) { | 126 if (db_->metadata_.id == kInvalidId) { |
122 // The database was deleted then immediately re-opened; OpenInternal() | 127 // The database was deleted then immediately re-opened; OpenInternal() |
123 // recreates it in the backing store. | 128 // recreates it in the backing store. |
124 if (!db_->OpenInternal().ok()) { | 129 if (!db_->OpenInternal().ok()) { |
125 // TODO(jsbell): Consider including sanitized leveldb status message. | 130 // TODO(jsbell): Consider including sanitized leveldb status message. |
126 base::string16 message; | 131 base::string16 message; |
127 if (pending_->version == IndexedDBDatabaseMetadata::NO_VERSION) { | 132 if (pending_->version == IndexedDBDatabaseMetadata::NO_VERSION) { |
128 message = ASCIIToUTF16( | 133 message = ASCIIToUTF16( |
129 "Internal error opening database with no version specified."); | 134 "Internal error opening database with no version specified."); |
130 } else { | 135 } else { |
(...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 | 2133 |
2129 void IndexedDBDatabase::VersionChangeAbortOperation( | 2134 void IndexedDBDatabase::VersionChangeAbortOperation( |
2130 int64_t previous_version, | 2135 int64_t previous_version, |
2131 IndexedDBTransaction* transaction) { | 2136 IndexedDBTransaction* transaction) { |
2132 DCHECK(!transaction); | 2137 DCHECK(!transaction); |
2133 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); | 2138 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); |
2134 metadata_.version = previous_version; | 2139 metadata_.version = previous_version; |
2135 } | 2140 } |
2136 | 2141 |
2137 } // namespace content | 2142 } // namespace content |
OLD | NEW |