| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/indexed_db/webidbcursor_impl.h" | 5 #include "content/browser/indexed_db/webidbcursor_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" | 7 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" |
| 8 #include "content/browser/indexed_db/indexed_db_cursor.h" | 8 #include "content/browser/indexed_db/indexed_db_cursor.h" |
| 9 #include "content/common/indexed_db/indexed_db_key.h" | 9 #include "content/common/indexed_db/indexed_db_key.h" |
| 10 #include "third_party/WebKit/public/platform/WebIDBKey.h" | 10 #include "third_party/WebKit/public/platform/WebIDBKey.h" |
| 11 | 11 |
| 12 using WebKit::WebIDBCallbacks; | |
| 13 | |
| 14 namespace content { | 12 namespace content { |
| 15 | 13 |
| 16 WebIDBCursorImpl::WebIDBCursorImpl( | 14 WebIDBCursorImpl::WebIDBCursorImpl( |
| 17 scoped_refptr<IndexedDBCursor> idb_cursor_backend) | 15 scoped_refptr<IndexedDBCursor> idb_cursor_backend) |
| 18 : idb_cursor_backend_(idb_cursor_backend) {} | 16 : idb_cursor_backend_(idb_cursor_backend) {} |
| 19 | 17 |
| 20 WebIDBCursorImpl::~WebIDBCursorImpl() {} | 18 WebIDBCursorImpl::~WebIDBCursorImpl() {} |
| 21 | 19 |
| 22 void WebIDBCursorImpl::advance(unsigned long count, | 20 void WebIDBCursorImpl::advance(unsigned long count, |
| 23 WebIDBCallbacks* callbacks) { | 21 IndexedDBCallbacksBase* callbacks) { |
| 24 idb_cursor_backend_->Advance(count, | 22 idb_cursor_backend_->Advance(count, |
| 25 IndexedDBCallbacksWrapper::Create(callbacks)); | 23 IndexedDBCallbacksWrapper::Create(callbacks)); |
| 26 } | 24 } |
| 27 | 25 |
| 28 void WebIDBCursorImpl::continueFunction(const WebKit::WebIDBKey& key, | 26 void WebIDBCursorImpl::continueFunction(const WebKit::WebIDBKey& key, |
| 29 WebIDBCallbacks* callbacks) { | 27 IndexedDBCallbacksBase* callbacks) { |
| 30 idb_cursor_backend_->ContinueFunction( | 28 idb_cursor_backend_->ContinueFunction( |
| 31 make_scoped_ptr(new IndexedDBKey(key)), | 29 make_scoped_ptr(new IndexedDBKey(key)), |
| 32 IndexedDBCallbacksWrapper::Create(callbacks)); | 30 IndexedDBCallbacksWrapper::Create(callbacks)); |
| 33 } | 31 } |
| 34 | 32 |
| 35 void WebIDBCursorImpl::prefetchContinue(int number_to_fetch, | 33 void WebIDBCursorImpl::prefetchContinue(int number_to_fetch, |
| 36 WebKit::WebIDBCallbacks* callbacks) { | 34 IndexedDBCallbacksBase* callbacks) { |
| 37 idb_cursor_backend_->PrefetchContinue( | 35 idb_cursor_backend_->PrefetchContinue( |
| 38 number_to_fetch, IndexedDBCallbacksWrapper::Create(callbacks)); | 36 number_to_fetch, IndexedDBCallbacksWrapper::Create(callbacks)); |
| 39 } | 37 } |
| 40 | 38 |
| 41 void WebIDBCursorImpl::prefetchReset(int used_prefetches, | 39 void WebIDBCursorImpl::prefetchReset(int used_prefetches, |
| 42 int unused_prefetches) { | 40 int unused_prefetches) { |
| 43 idb_cursor_backend_->PrefetchReset(used_prefetches, unused_prefetches); | 41 idb_cursor_backend_->PrefetchReset(used_prefetches, unused_prefetches); |
| 44 } | 42 } |
| 45 | 43 |
| 46 } // namespace content | 44 } // namespace content |
| OLD | NEW |