| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/renderer_webidbcursor_impl.h" | 5 #include "chrome/renderer/renderer_webidbcursor_impl.h" |
| 6 | 6 |
| 7 #include "chrome/common/indexed_db_messages.h" | 7 #include "chrome/common/indexed_db_messages.h" |
| 8 #include "chrome/renderer/indexed_db_dispatcher.h" | 8 #include "chrome/renderer/indexed_db_dispatcher.h" |
| 9 #include "chrome/renderer/render_thread.h" | 9 #include "chrome/renderer/render_thread.h" |
| 10 | 10 |
| 11 using WebKit::WebExceptionCode; | 11 using WebKit::WebExceptionCode; |
| 12 using WebKit::WebIDBCallbacks; | 12 using WebKit::WebIDBCallbacks; |
| 13 using WebKit::WebIDBKey; | 13 using WebKit::WebIDBKey; |
| 14 using WebKit::WebSerializedScriptValue; | 14 using WebKit::WebSerializedScriptValue; |
| 15 | 15 |
| 16 RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id) | 16 RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id) |
| 17 : idb_cursor_id_(idb_cursor_id) { | 17 : idb_cursor_id_(idb_cursor_id) { |
| 18 } | 18 } |
| 19 | 19 |
| 20 RendererWebIDBCursorImpl::~RendererWebIDBCursorImpl() { | 20 RendererWebIDBCursorImpl::~RendererWebIDBCursorImpl() { |
| 21 // It's not possible for there to be pending callbacks that address this |
| 22 // object since inside WebKit, they hold a reference to the object wich owns |
| 23 // this object. But, if that ever changed, then we'd need to invalidate |
| 24 // any such pointers. |
| 21 RenderThread::current()->Send(new IndexedDBHostMsg_CursorDestroyed( | 25 RenderThread::current()->Send(new IndexedDBHostMsg_CursorDestroyed( |
| 22 idb_cursor_id_)); | 26 idb_cursor_id_)); |
| 23 } | 27 } |
| 24 | 28 |
| 25 unsigned short RendererWebIDBCursorImpl::direction() const { | 29 unsigned short RendererWebIDBCursorImpl::direction() const { |
| 26 int direction; | 30 int direction; |
| 27 RenderThread::current()->Send( | 31 RenderThread::current()->Send( |
| 28 new IndexedDBHostMsg_CursorDirection(idb_cursor_id_, &direction)); | 32 new IndexedDBHostMsg_CursorDirection(idb_cursor_id_, &direction)); |
| 29 return direction; | 33 return direction; |
| 30 } | 34 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks, | 71 dispatcher->RequestIDBCursorContinue(IndexedDBKey(key), callbacks, |
| 68 idb_cursor_id_, &ec); | 72 idb_cursor_id_, &ec); |
| 69 } | 73 } |
| 70 | 74 |
| 71 void RendererWebIDBCursorImpl::remove(WebIDBCallbacks* callbacks, | 75 void RendererWebIDBCursorImpl::remove(WebIDBCallbacks* callbacks, |
| 72 WebExceptionCode& ec) { | 76 WebExceptionCode& ec) { |
| 73 IndexedDBDispatcher* dispatcher = | 77 IndexedDBDispatcher* dispatcher = |
| 74 RenderThread::current()->indexed_db_dispatcher(); | 78 RenderThread::current()->indexed_db_dispatcher(); |
| 75 dispatcher->RequestIDBCursorDelete(callbacks, idb_cursor_id_, &ec); | 79 dispatcher->RequestIDBCursorDelete(callbacks, idb_cursor_id_, &ec); |
| 76 } | 80 } |
| OLD | NEW |