| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/child/indexed_db/webidbdatabase_impl.h" | 5 #include "content/child/indexed_db/webidbdatabase_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void WebIDBDatabaseImpl::versionChangeIgnored() { | 99 void WebIDBDatabaseImpl::versionChangeIgnored() { |
| 100 IndexedDBDispatcher* dispatcher = | 100 IndexedDBDispatcher* dispatcher = |
| 101 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 101 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 102 dispatcher->NotifyIDBDatabaseVersionChangeIgnored(ipc_database_id_); | 102 dispatcher->NotifyIDBDatabaseVersionChangeIgnored(ipc_database_id_); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WebIDBDatabaseImpl::observe(blink::IDBObserver* observer, | 105 void WebIDBDatabaseImpl::observe(blink::IDBObserver* observer, |
| 106 long long transaction_id) { | 106 long long transaction_id) { |
| 107 IndexedDBDispatcher* dispatcher = | 107 IndexedDBDispatcher* dispatcher = |
| 108 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 108 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 109 dispatcher->AddIDBObserver(ipc_database_id_, transaction_id, observer); | 109 int32_t observer_id = |
| 110 dispatcher->AddIDBObserver(ipc_database_id_, transaction_id, observer); |
| 111 observers_id_.push_back(observer_id); |
| 112 } |
| 113 |
| 114 void WebIDBDatabaseImpl::unobserve(blink::IDBObserver* observer) { |
| 115 IndexedDBDispatcher* dispatcher = |
| 116 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 117 std::vector<int32_t> remove_observers = |
| 118 dispatcher->RemoveIDBObserver(ipc_database_id_, observer); |
| 119 // TODO(palakj): Remove id from observes_id_ |
| 110 } | 120 } |
| 111 | 121 |
| 112 void WebIDBDatabaseImpl::get(long long transaction_id, | 122 void WebIDBDatabaseImpl::get(long long transaction_id, |
| 113 long long object_store_id, | 123 long long object_store_id, |
| 114 long long index_id, | 124 long long index_id, |
| 115 const WebIDBKeyRange& key_range, | 125 const WebIDBKeyRange& key_range, |
| 116 bool key_only, | 126 bool key_only, |
| 117 WebIDBCallbacks* callbacks) { | 127 WebIDBCallbacks* callbacks) { |
| 118 IndexedDBDispatcher* dispatcher = | 128 IndexedDBDispatcher* dispatcher = |
| 119 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 129 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 310 |
| 301 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { | 311 void WebIDBDatabaseImpl::ackReceivedBlobs(const WebVector<WebString>& uuids) { |
| 302 DCHECK(uuids.size()); | 312 DCHECK(uuids.size()); |
| 303 std::vector<std::string> param(uuids.size()); | 313 std::vector<std::string> param(uuids.size()); |
| 304 for (size_t i = 0; i < uuids.size(); ++i) | 314 for (size_t i = 0; i < uuids.size(); ++i) |
| 305 param[i] = uuids[i].latin1().data(); | 315 param[i] = uuids[i].latin1().data(); |
| 306 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); | 316 thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(param)); |
| 307 } | 317 } |
| 308 | 318 |
| 309 } // namespace content | 319 } // namespace content |
| OLD | NEW |