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

Side by Side Diff: content/child/indexed_db/indexed_db_dispatcher.cc

Issue 1832553002: IndexedDB: Pass url::Origin rather than GURL over IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@origin-wdb
Patch Set: Rebased Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/child/indexed_db/indexed_db_dispatcher.h" 5 #include "content/child/indexed_db/indexed_db_dispatcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 Send(new IndexedDBHostMsg_CursorPrefetchReset( 215 Send(new IndexedDBHostMsg_CursorPrefetchReset(
216 ipc_cursor_id, used_prefetches, unused_prefetches)); 216 ipc_cursor_id, used_prefetches, unused_prefetches));
217 } 217 }
218 218
219 void IndexedDBDispatcher::RequestIDBFactoryOpen( 219 void IndexedDBDispatcher::RequestIDBFactoryOpen(
220 const base::string16& name, 220 const base::string16& name,
221 int64_t version, 221 int64_t version,
222 int64_t transaction_id, 222 int64_t transaction_id,
223 WebIDBCallbacks* callbacks_ptr, 223 WebIDBCallbacks* callbacks_ptr,
224 WebIDBDatabaseCallbacks* database_callbacks_ptr, 224 WebIDBDatabaseCallbacks* database_callbacks_ptr,
225 const GURL& origin) { 225 const url::Origin& origin) {
226 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); 226 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
227 std::unique_ptr<WebIDBDatabaseCallbacks> database_callbacks( 227 std::unique_ptr<WebIDBDatabaseCallbacks> database_callbacks(
228 database_callbacks_ptr); 228 database_callbacks_ptr);
229 229
230 IndexedDBHostMsg_FactoryOpen_Params params; 230 IndexedDBHostMsg_FactoryOpen_Params params;
231 params.ipc_thread_id = CurrentWorkerId(); 231 params.ipc_thread_id = CurrentWorkerId();
232 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); 232 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
233 params.ipc_database_callbacks_id = 233 params.ipc_database_callbacks_id =
234 pending_database_callbacks_.Add(database_callbacks.release()); 234 pending_database_callbacks_.Add(database_callbacks.release());
235 params.origin = origin; 235 params.origin = origin;
236 params.name = name; 236 params.name = name;
237 params.transaction_id = transaction_id; 237 params.transaction_id = transaction_id;
238 params.version = version; 238 params.version = version;
239 Send(new IndexedDBHostMsg_FactoryOpen(params)); 239 Send(new IndexedDBHostMsg_FactoryOpen(params));
240 } 240 }
241 241
242 void IndexedDBDispatcher::RequestIDBFactoryGetDatabaseNames( 242 void IndexedDBDispatcher::RequestIDBFactoryGetDatabaseNames(
243 WebIDBCallbacks* callbacks_ptr, 243 WebIDBCallbacks* callbacks_ptr,
244 const GURL& origin) { 244 const url::Origin& origin) {
245 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); 245 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
246 246
247 IndexedDBHostMsg_FactoryGetDatabaseNames_Params params; 247 IndexedDBHostMsg_FactoryGetDatabaseNames_Params params;
248 params.ipc_thread_id = CurrentWorkerId(); 248 params.ipc_thread_id = CurrentWorkerId();
249 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); 249 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
250 params.origin = origin; 250 params.origin = origin;
251 Send(new IndexedDBHostMsg_FactoryGetDatabaseNames(params)); 251 Send(new IndexedDBHostMsg_FactoryGetDatabaseNames(params));
252 } 252 }
253 253
254 void IndexedDBDispatcher::RequestIDBFactoryDeleteDatabase( 254 void IndexedDBDispatcher::RequestIDBFactoryDeleteDatabase(
255 const base::string16& name, 255 const base::string16& name,
256 WebIDBCallbacks* callbacks_ptr, 256 WebIDBCallbacks* callbacks_ptr,
257 const GURL& origin) { 257 const url::Origin& origin) {
258 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); 258 std::unique_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
259 259
260 IndexedDBHostMsg_FactoryDeleteDatabase_Params params; 260 IndexedDBHostMsg_FactoryDeleteDatabase_Params params;
261 params.ipc_thread_id = CurrentWorkerId(); 261 params.ipc_thread_id = CurrentWorkerId();
262 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release()); 262 params.ipc_callbacks_id = pending_callbacks_.Add(callbacks.release());
263 params.origin = origin; 263 params.origin = origin;
264 params.name = name; 264 params.name = name;
265 Send(new IndexedDBHostMsg_FactoryDeleteDatabase(params)); 265 Send(new IndexedDBHostMsg_FactoryDeleteDatabase(params));
266 } 266 }
267 267
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator; 800 typedef std::map<int32_t, WebIDBCursorImpl*>::iterator Iterator;
801 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { 801 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) {
802 if (i->first == ipc_exception_cursor_id || 802 if (i->first == ipc_exception_cursor_id ||
803 i->second->transaction_id() != transaction_id) 803 i->second->transaction_id() != transaction_id)
804 continue; 804 continue;
805 i->second->ResetPrefetchCache(); 805 i->second->ResetPrefetchCache();
806 } 806 }
807 } 807 }
808 808
809 } // namespace content 809 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698