OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/indexed_db_dispatcher.h" | 5 #include "chrome/renderer/indexed_db_dispatcher.h" |
6 | 6 |
7 #include "chrome/common/indexed_db_key.h" | 7 #include "chrome/common/indexed_db_key.h" |
8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 #include "chrome/common/render_messages_params.h" | 9 #include "chrome/common/render_messages_params.h" |
10 #include "chrome/common/serialized_script_value.h" | 10 #include "chrome/common/serialized_script_value.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 WebIDBCallbacks* callbacks_ptr, | 94 WebIDBCallbacks* callbacks_ptr, |
95 int32 idb_cursor_id) { | 95 int32 idb_cursor_id) { |
96 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); | 96 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
97 | 97 |
98 RenderThread::current()->Send( | 98 RenderThread::current()->Send( |
99 new ViewHostMsg_IDBCursorRemove( | 99 new ViewHostMsg_IDBCursorRemove( |
100 idb_cursor_id, pending_callbacks_.Add(callbacks.release()))); | 100 idb_cursor_id, pending_callbacks_.Add(callbacks.release()))); |
101 } | 101 } |
102 | 102 |
103 void IndexedDBDispatcher::RequestIDBFactoryOpen( | 103 void IndexedDBDispatcher::RequestIDBFactoryOpen( |
104 const string16& name, const string16& description, | 104 const string16& name, |
105 WebIDBCallbacks* callbacks_ptr, const string16& origin, | 105 const string16& description, |
106 WebFrame* web_frame) { | 106 WebIDBCallbacks* callbacks_ptr, |
| 107 const string16& origin, |
| 108 WebFrame* web_frame, |
| 109 uint64 maximum_size) { |
107 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); | 110 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
108 | 111 |
109 if (!web_frame) | 112 if (!web_frame) |
110 return; // We must be shutting down. | 113 return; // We must be shutting down. |
111 RenderView* render_view = RenderView::FromWebView(web_frame->view()); | 114 RenderView* render_view = RenderView::FromWebView(web_frame->view()); |
112 if (!render_view) | 115 if (!render_view) |
113 return; // We must be shutting down. | 116 return; // We must be shutting down. |
114 | 117 |
115 ViewHostMsg_IDBFactoryOpen_Params params; | 118 ViewHostMsg_IDBFactoryOpen_Params params; |
116 params.routing_id_ = render_view->routing_id(); | 119 params.routing_id_ = render_view->routing_id(); |
117 params.response_id_ = pending_callbacks_.Add(callbacks.release()); | 120 params.response_id_ = pending_callbacks_.Add(callbacks.release()); |
118 params.origin_ = origin; | 121 params.origin_ = origin; |
119 params.name_ = name; | 122 params.name_ = name; |
120 params.description_ = description; | 123 params.description_ = description; |
| 124 params.maximum_size_ = maximum_size; |
121 RenderThread::current()->Send(new ViewHostMsg_IDBFactoryOpen(params)); | 125 RenderThread::current()->Send(new ViewHostMsg_IDBFactoryOpen(params)); |
122 } | 126 } |
123 | 127 |
124 void IndexedDBDispatcher::RequestIDBDatabaseSetVersion( | 128 void IndexedDBDispatcher::RequestIDBDatabaseSetVersion( |
125 const string16& version, | 129 const string16& version, |
126 WebIDBCallbacks* callbacks_ptr, | 130 WebIDBCallbacks* callbacks_ptr, |
127 int32 idb_database_id) { | 131 int32 idb_database_id) { |
128 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); | 132 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); |
129 | 133 |
130 RenderThread::current()->Send( | 134 RenderThread::current()->Send( |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 callbacks->onComplete(); | 355 callbacks->onComplete(); |
352 pending_transaction_callbacks_.Remove(transaction_id); | 356 pending_transaction_callbacks_.Remove(transaction_id); |
353 } | 357 } |
354 | 358 |
355 void IndexedDBDispatcher::OnTimeout(int32 transaction_id) { | 359 void IndexedDBDispatcher::OnTimeout(int32 transaction_id) { |
356 WebIDBTransactionCallbacks* callbacks = | 360 WebIDBTransactionCallbacks* callbacks = |
357 pending_transaction_callbacks_.Lookup(transaction_id); | 361 pending_transaction_callbacks_.Lookup(transaction_id); |
358 callbacks->onTimeout(); | 362 callbacks->onTimeout(); |
359 pending_transaction_callbacks_.Remove(transaction_id); | 363 pending_transaction_callbacks_.Remove(transaction_id); |
360 } | 364 } |
OLD | NEW |