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

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

Issue 2438233004: Make IndexedDBConnection IDs independent from the IPC database ID. (Closed)
Patch Set: Created 4 years, 2 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_connection.cc
diff --git a/content/browser/indexed_db/indexed_db_connection.cc b/content/browser/indexed_db/indexed_db_connection.cc
index a749154090bf09bf36297e38a208a7da6891d0f3..0c3cb35c010e67a465f12fd891998bff8441df93 100644
--- a/content/browser/indexed_db/indexed_db_connection.cc
+++ b/content/browser/indexed_db/indexed_db_connection.cc
@@ -8,18 +8,22 @@
namespace content {
+namespace {
+
+static int32_t next_id;
+
+} // namespace
+
IndexedDBConnection::IndexedDBConnection(
scoped_refptr<IndexedDBDatabase> database,
scoped_refptr<IndexedDBDatabaseCallbacks> callbacks)
- : database_(database), callbacks_(callbacks), weak_factory_(this) {}
+ : id_(next_id++),
+ database_(database),
+ callbacks_(callbacks),
+ weak_factory_(this) {}
IndexedDBConnection::~IndexedDBConnection() {}
-void IndexedDBConnection::set_id(int32_t id) {
- DCHECK_EQ(id_, kInvalidId);
- id_ = id;
-}
-
void IndexedDBConnection::Close() {
if (!callbacks_.get())
return;
« no previous file with comments | « content/browser/indexed_db/indexed_db_connection.h ('k') | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698