| OLD | NEW |
| 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/common/indexed_db/proxy_webidbcursor_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbcursor_impl.h" |
| 6 | 6 |
| 7 #include "content/common/child_thread.h" | 7 #include "content/common/child_thread.h" |
| 8 #include "content/common/indexed_db/indexed_db_messages.h" | 8 #include "content/common/indexed_db/indexed_db_messages.h" |
| 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value, | 55 void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value, |
| 56 WebIDBCallbacks* callbacks, | 56 WebIDBCallbacks* callbacks, |
| 57 WebExceptionCode& ec) { | 57 WebExceptionCode& ec) { |
| 58 IndexedDBDispatcher* dispatcher = | 58 IndexedDBDispatcher* dispatcher = |
| 59 IndexedDBDispatcher::ThreadSpecificInstance(); | 59 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 60 dispatcher->RequestIDBCursorUpdate( | 60 dispatcher->RequestIDBCursorUpdate( |
| 61 content::SerializedScriptValue(value), callbacks, idb_cursor_id_, &ec); | 61 content::SerializedScriptValue(value), callbacks, idb_cursor_id_, &ec); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void RendererWebIDBCursorImpl::advance(unsigned long count, |
| 65 WebIDBCallbacks* callbacks_ptr, |
| 66 WebExceptionCode& ec) { |
| 67 IndexedDBDispatcher* dispatcher = |
| 68 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 69 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
| 70 ResetPrefetchCache(); |
| 71 dispatcher->RequestIDBCursorAdvance(count, callbacks.release(), |
| 72 idb_cursor_id_, &ec); |
| 73 } |
| 74 |
| 64 void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key, | 75 void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key, |
| 65 WebIDBCallbacks* callbacks_ptr, | 76 WebIDBCallbacks* callbacks_ptr, |
| 66 WebExceptionCode& ec) { | 77 WebExceptionCode& ec) { |
| 67 IndexedDBDispatcher* dispatcher = | 78 IndexedDBDispatcher* dispatcher = |
| 68 IndexedDBDispatcher::ThreadSpecificInstance(); | 79 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 69 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); | 80 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
| 70 | 81 |
| 71 if (key.type() == WebIDBKey::NullType) { | 82 if (key.type() == WebIDBKey::NullType) { |
| 72 // No key, so this would qualify for a prefetch. | 83 // No key, so this would qualify for a prefetch. |
| 73 ++continue_count_; | 84 ++continue_count_; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 IndexedDBDispatcher::ThreadSpecificInstance(); | 185 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 175 dispatcher->RequestIDBCursorPrefetchReset(used_prefetches_, | 186 dispatcher->RequestIDBCursorPrefetchReset(used_prefetches_, |
| 176 prefetch_keys_.size(), | 187 prefetch_keys_.size(), |
| 177 idb_cursor_id_); | 188 idb_cursor_id_); |
| 178 prefetch_keys_.clear(); | 189 prefetch_keys_.clear(); |
| 179 prefetch_primary_keys_.clear(); | 190 prefetch_primary_keys_.clear(); |
| 180 prefetch_values_.clear(); | 191 prefetch_values_.clear(); |
| 181 | 192 |
| 182 pending_onsuccess_callbacks_ = 0; | 193 pending_onsuccess_callbacks_ = 0; |
| 183 } | 194 } |
| OLD | NEW |