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

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

Issue 7834006: Consolidate key, primary key, value cursor messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unused messages Created 9 years, 3 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 | 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_webidbcursor_impl.h" 5 #include "content/renderer/renderer_webidbcursor_impl.h"
6 6
7 #include "content/common/indexed_db_messages.h" 7 #include "content/common/indexed_db_messages.h"
8 #include "content/renderer/indexed_db_dispatcher.h" 8 #include "content/renderer/indexed_db_dispatcher.h"
9 #include "content/renderer/render_thread.h" 9 #include "content/renderer/render_thread.h"
10 10
(...skipping 15 matching lines...) Expand all
26 idb_cursor_id_)); 26 idb_cursor_id_));
27 } 27 }
28 28
29 unsigned short RendererWebIDBCursorImpl::direction() const { 29 unsigned short RendererWebIDBCursorImpl::direction() const {
30 int direction; 30 int direction;
31 RenderThread::current()->Send( 31 RenderThread::current()->Send(
32 new IndexedDBHostMsg_CursorDirection(idb_cursor_id_, &direction)); 32 new IndexedDBHostMsg_CursorDirection(idb_cursor_id_, &direction));
33 return direction; 33 return direction;
34 } 34 }
35 35
36 WebIDBKey RendererWebIDBCursorImpl::key() const {
37 IndexedDBKey key;
38 RenderThread::current()->Send(
39 new IndexedDBHostMsg_CursorKey(idb_cursor_id_, &key));
40 return key;
41 }
42
43 WebIDBKey RendererWebIDBCursorImpl::primaryKey() const {
44 IndexedDBKey primaryKey;
45 RenderThread::current()->Send(
46 new IndexedDBHostMsg_CursorPrimaryKey(idb_cursor_id_, &primaryKey));
47 return primaryKey;
48 }
49
50 WebSerializedScriptValue RendererWebIDBCursorImpl::value() const {
51 SerializedScriptValue scriptValue;
52 RenderThread::current()->Send(
53 new IndexedDBHostMsg_CursorValue(idb_cursor_id_, &scriptValue));
54 return scriptValue;
55 }
56
57 void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value, 36 void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value,
58 WebIDBCallbacks* callbacks, 37 WebIDBCallbacks* callbacks,
59 WebExceptionCode& ec) { 38 WebExceptionCode& ec) {
60 IndexedDBDispatcher* dispatcher = 39 IndexedDBDispatcher* dispatcher =
61 RenderThread::current()->indexed_db_dispatcher(); 40 RenderThread::current()->indexed_db_dispatcher();
62 dispatcher->RequestIDBCursorUpdate(SerializedScriptValue(value), callbacks, 41 dispatcher->RequestIDBCursorUpdate(SerializedScriptValue(value), callbacks,
63 idb_cursor_id_, &ec); 42 idb_cursor_id_, &ec);
64 } 43 }
65 44
66 void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key, 45 void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key,
67 WebIDBCallbacks* callbacks, 46 WebIDBCallbacks* callbacks,
68 WebExceptionCode& ec) { 47 WebExceptionCode& ec) {
69 IndexedDBDispatcher* dispatcher = 48 IndexedDBDispatcher* dispatcher =
70 RenderThread::current()->indexed_db_dispatcher(); 49 RenderThread::current()->indexed_db_dispatcher();
71 dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks, 50 dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks,
72 idb_cursor_id_, &ec); 51 idb_cursor_id_, &ec);
73 } 52 }
74 53
75 void RendererWebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks, 54 void RendererWebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks,
76 WebExceptionCode& ec) { 55 WebExceptionCode& ec) {
77 IndexedDBDispatcher* dispatcher = 56 IndexedDBDispatcher* dispatcher =
78 RenderThread::current()->indexed_db_dispatcher(); 57 RenderThread::current()->indexed_db_dispatcher();
79 dispatcher->RequestIDBCursorDelete(callbacks, idb_cursor_id_, &ec); 58 dispatcher->RequestIDBCursorDelete(callbacks, idb_cursor_id_, &ec);
80 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698