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

Side by Side Diff: content/browser/indexed_db/indexed_db_dispatcher_host.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_dispatcher_host.h" 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 int32_t IndexedDBDispatcherHost::Add(IndexedDBConnection* connection, 154 int32_t IndexedDBDispatcherHost::Add(IndexedDBConnection* connection,
155 const url::Origin& origin) { 155 const url::Origin& origin) {
156 if (!database_dispatcher_host_) { 156 if (!database_dispatcher_host_) {
157 connection->Close(); 157 connection->Close();
158 delete connection; 158 delete connection;
159 return -1; 159 return -1;
160 } 160 }
161 int32_t ipc_database_id = database_dispatcher_host_->map_.Add(connection); 161 int32_t ipc_database_id = database_dispatcher_host_->map_.Add(connection);
162 connection->set_id(ipc_database_id);
163 context()->ConnectionOpened(origin, connection); 162 context()->ConnectionOpened(origin, connection);
164 database_dispatcher_host_->database_origin_map_[ipc_database_id] = origin; 163 database_dispatcher_host_->database_origin_map_[ipc_database_id] = origin;
165 return ipc_database_id; 164 return ipc_database_id;
166 } 165 }
167 166
168 void IndexedDBDispatcherHost::RegisterTransactionId(int64_t host_transaction_id, 167 void IndexedDBDispatcherHost::RegisterTransactionId(int64_t host_transaction_id,
169 const url::Origin& origin) { 168 const url::Origin& origin) {
170 if (!database_dispatcher_host_) 169 if (!database_dispatcher_host_)
171 return; 170 return;
172 database_dispatcher_host_->transaction_size_map_[host_transaction_id] = 0; 171 database_dispatcher_host_->transaction_size_map_[host_transaction_id] = 0;
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 DLOG(ERROR) << "Unable to reset prefetch"; 1109 DLOG(ERROR) << "Unable to reset prefetch";
1111 } 1110 }
1112 1111
1113 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 1112 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
1114 int32_t ipc_object_id) { 1113 int32_t ipc_object_id) {
1115 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread()); 1114 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread());
1116 parent_->DestroyObject(&map_, ipc_object_id); 1115 parent_->DestroyObject(&map_, ipc_object_id);
1117 } 1116 }
1118 1117
1119 } // namespace content 1118 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_database_callbacks.cc ('k') | content/child/indexed_db/indexed_db_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698