Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: content/browser/indexed_db/indexed_db_callbacks_wrapper.cc

Issue 18145004: IndexedDB: Eliminate WebIDBCursor wrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/indexed_db_callbacks.h" 5 #include "content/browser/indexed_db/indexed_db_callbacks.h"
6 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" 6 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h"
7 #include "content/browser/indexed_db/indexed_db_cursor.h" 7 #include "content/browser/indexed_db/indexed_db_cursor.h"
8 #include "content/browser/indexed_db/indexed_db_metadata.h" 8 #include "content/browser/indexed_db/indexed_db_metadata.h"
9 #include "content/browser/indexed_db/webidbcursor_impl.h"
10 #include "content/browser/indexed_db/webidbdatabase_impl.h" 9 #include "content/browser/indexed_db/webidbdatabase_impl.h"
11 10
12 namespace content { 11 namespace content {
13 12
14 using WebKit::WebIDBCallbacks; 13 using WebKit::WebIDBCallbacks;
15 14
16 IndexedDBCallbacksWrapper::IndexedDBCallbacksWrapper( 15 IndexedDBCallbacksWrapper::IndexedDBCallbacksWrapper(
17 IndexedDBCallbacksBase* callbacks) 16 IndexedDBCallbacksBase* callbacks)
18 : callbacks_(callbacks), did_complete_(false), did_create_proxy_(false) {} 17 : callbacks_(callbacks), did_complete_(false), did_create_proxy_(false) {}
19 18
20 IndexedDBCallbacksWrapper::~IndexedDBCallbacksWrapper() {} 19 IndexedDBCallbacksWrapper::~IndexedDBCallbacksWrapper() {}
21 20
22 void IndexedDBCallbacksWrapper::OnError(const IndexedDBDatabaseError& error) { 21 void IndexedDBCallbacksWrapper::OnError(const IndexedDBDatabaseError& error) {
23 DCHECK(callbacks_); 22 DCHECK(callbacks_);
24 callbacks_->onError(error); 23 callbacks_->onError(error);
25 callbacks_.reset(); 24 callbacks_.reset();
26 } 25 }
27 26
28 void IndexedDBCallbacksWrapper::OnSuccess(const std::vector<string16>& value) { 27 void IndexedDBCallbacksWrapper::OnSuccess(const std::vector<string16>& value) {
29 DCHECK(callbacks_); 28 DCHECK(callbacks_);
30 callbacks_->onSuccess(value); 29 callbacks_->onSuccess(value);
31 callbacks_.reset(); 30 callbacks_.reset();
32 } 31 }
33 32
34 void IndexedDBCallbacksWrapper::OnSuccess(scoped_refptr<IndexedDBCursor> cursor, 33 void IndexedDBCallbacksWrapper::OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
35 const IndexedDBKey& key, 34 const IndexedDBKey& key,
36 const IndexedDBKey& primary_key, 35 const IndexedDBKey& primary_key,
37 std::vector<char>* value) { 36 std::vector<char>* value) {
38 DCHECK(callbacks_); 37 DCHECK(callbacks_);
39 callbacks_->onSuccess(new WebIDBCursorImpl(cursor), key, primary_key, value); 38 callbacks_->onSuccess(cursor, key, primary_key, value);
40 callbacks_.reset(); 39 callbacks_.reset();
41 } 40 }
42 41
43 void IndexedDBCallbacksWrapper::OnSuccess(const IndexedDBKey& key) { 42 void IndexedDBCallbacksWrapper::OnSuccess(const IndexedDBKey& key) {
44 DCHECK(callbacks_); 43 DCHECK(callbacks_);
45 callbacks_->onSuccess(key); 44 callbacks_->onSuccess(key);
46 callbacks_.reset(); 45 callbacks_.reset();
47 } 46 }
48 47
49 void IndexedDBCallbacksWrapper::OnSuccess(std::vector<char>* value) { 48 void IndexedDBCallbacksWrapper::OnSuccess(std::vector<char>* value) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 124
126 callbacks_->onSuccess(impl, metadata); 125 callbacks_->onSuccess(impl, metadata);
127 callbacks_.reset(); 126 callbacks_.reset();
128 } 127 }
129 128
130 void IndexedDBCallbacksWrapper::SetDatabaseCallbacks( 129 void IndexedDBCallbacksWrapper::SetDatabaseCallbacks(
131 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks) { 130 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks) {
132 database_callbacks_ = database_callbacks; 131 database_callbacks_ = database_callbacks;
133 } 132 }
134 } // namespace content 133 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_callbacks_wrapper.h ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698