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

Side by Side Diff: content/renderer/renderer_webidbobjectstore_impl.cc

Issue 8747002: Dispatch IndexedDB IPC messages to worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove some includes Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/renderer_webidbobjectstore_impl.h" 5 #include "content/renderer/renderer_webidbobjectstore_impl.h"
6 6
7 #include "content/common/indexed_db_messages.h" 7 #include "content/common/indexed_db_messages.h"
8 #include "content/public/common/serialized_script_value.h" 8 #include "content/public/common/serialized_script_value.h"
9 #include "content/renderer/indexed_db_dispatcher.h" 9 #include "content/renderer/indexed_db_dispatcher.h"
10 #include "content/renderer/render_thread_impl.h" 10 #include "content/renderer/render_thread_impl.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 web_result.append(*it); 67 web_result.append(*it);
68 } 68 }
69 return web_result; 69 return web_result;
70 } 70 }
71 71
72 void RendererWebIDBObjectStoreImpl::get( 72 void RendererWebIDBObjectStoreImpl::get(
73 const WebIDBKey& key, 73 const WebIDBKey& key,
74 WebIDBCallbacks* callbacks, 74 WebIDBCallbacks* callbacks,
75 const WebIDBTransaction& transaction, 75 const WebIDBTransaction& transaction,
76 WebExceptionCode& ec) { 76 WebExceptionCode& ec) {
77 IndexedDBDispatcher* dispatcher = 77 IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::Instance();
78 RenderThreadImpl::current()->indexed_db_dispatcher();
79 dispatcher->RequestIDBObjectStoreGet( 78 dispatcher->RequestIDBObjectStoreGet(
80 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); 79 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec);
81 } 80 }
82 81
83 void RendererWebIDBObjectStoreImpl::put( 82 void RendererWebIDBObjectStoreImpl::put(
84 const WebSerializedScriptValue& value, 83 const WebSerializedScriptValue& value,
85 const WebIDBKey& key, 84 const WebIDBKey& key,
86 PutMode put_mode, 85 PutMode put_mode,
87 WebIDBCallbacks* callbacks, 86 WebIDBCallbacks* callbacks,
88 const WebIDBTransaction& transaction, 87 const WebIDBTransaction& transaction,
89 WebExceptionCode& ec) { 88 WebExceptionCode& ec) {
90 IndexedDBDispatcher* dispatcher = 89 IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::Instance();
91 RenderThreadImpl::current()->indexed_db_dispatcher();
92 dispatcher->RequestIDBObjectStorePut( 90 dispatcher->RequestIDBObjectStorePut(
93 content::SerializedScriptValue(value), IndexedDBKey(key), put_mode, 91 content::SerializedScriptValue(value), IndexedDBKey(key), put_mode,
94 callbacks, idb_object_store_id_, transaction, &ec); 92 callbacks, idb_object_store_id_, transaction, &ec);
95 } 93 }
96 94
97 void RendererWebIDBObjectStoreImpl::deleteFunction( 95 void RendererWebIDBObjectStoreImpl::deleteFunction(
98 const WebIDBKey& key, 96 const WebIDBKey& key,
99 WebIDBCallbacks* callbacks, 97 WebIDBCallbacks* callbacks,
100 const WebIDBTransaction& transaction, 98 const WebIDBTransaction& transaction,
101 WebExceptionCode& ec) { 99 WebExceptionCode& ec) {
102 IndexedDBDispatcher* dispatcher = 100 IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::Instance();
103 RenderThreadImpl::current()->indexed_db_dispatcher();
104 dispatcher->RequestIDBObjectStoreDelete( 101 dispatcher->RequestIDBObjectStoreDelete(
105 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec); 102 IndexedDBKey(key), callbacks, idb_object_store_id_, transaction, &ec);
106 } 103 }
107 104
108 void RendererWebIDBObjectStoreImpl::clear( 105 void RendererWebIDBObjectStoreImpl::clear(
109 WebIDBCallbacks* callbacks, 106 WebIDBCallbacks* callbacks,
110 const WebIDBTransaction& transaction, 107 const WebIDBTransaction& transaction,
111 WebExceptionCode& ec) { 108 WebExceptionCode& ec) {
112 IndexedDBDispatcher* dispatcher = 109 IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::Instance();
113 RenderThreadImpl::current()->indexed_db_dispatcher();
114 dispatcher->RequestIDBObjectStoreClear( 110 dispatcher->RequestIDBObjectStoreClear(
115 callbacks, idb_object_store_id_, transaction, &ec); 111 callbacks, idb_object_store_id_, transaction, &ec);
116 } 112 }
117 113
118 WebIDBIndex* RendererWebIDBObjectStoreImpl::createIndex( 114 WebIDBIndex* RendererWebIDBObjectStoreImpl::createIndex(
119 const WebString& name, 115 const WebString& name,
120 const WebString& key_path, 116 const WebString& key_path,
121 bool unique, 117 bool unique,
122 bool multi_entry, 118 bool multi_entry,
123 const WebIDBTransaction& transaction, 119 const WebIDBTransaction& transaction,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 new IndexedDBHostMsg_ObjectStoreDeleteIndex( 154 new IndexedDBHostMsg_ObjectStoreDeleteIndex(
159 idb_object_store_id_, name, 155 idb_object_store_id_, name,
160 IndexedDBDispatcher::TransactionId(transaction), &ec)); 156 IndexedDBDispatcher::TransactionId(transaction), &ec));
161 } 157 }
162 158
163 void RendererWebIDBObjectStoreImpl::openCursor( 159 void RendererWebIDBObjectStoreImpl::openCursor(
164 const WebIDBKeyRange& idb_key_range, 160 const WebIDBKeyRange& idb_key_range,
165 unsigned short direction, WebIDBCallbacks* callbacks, 161 unsigned short direction, WebIDBCallbacks* callbacks,
166 const WebIDBTransaction& transaction, 162 const WebIDBTransaction& transaction,
167 WebExceptionCode& ec) { 163 WebExceptionCode& ec) {
168 IndexedDBDispatcher* dispatcher = 164 IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::Instance();
169 RenderThreadImpl::current()->indexed_db_dispatcher();
170 dispatcher->RequestIDBObjectStoreOpenCursor( 165 dispatcher->RequestIDBObjectStoreOpenCursor(
171 idb_key_range, direction, callbacks, idb_object_store_id_, 166 idb_key_range, direction, callbacks, idb_object_store_id_,
172 transaction, &ec); 167 transaction, &ec);
173 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698