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

Side by Side Diff: content/browser/indexed_db/indexed_db_callbacks.h

Issue 197753011: Add IndexedDBValue wrapper class to group blob info with bits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a bit of extra blob_info stuff that leaked in. Created 6 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "content/browser/indexed_db/indexed_db_database_error.h" 16 #include "content/browser/indexed_db/indexed_db_database_error.h"
17 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" 17 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
18 #include "content/common/indexed_db/indexed_db_key.h" 18 #include "content/common/indexed_db/indexed_db_key.h"
19 #include "content/common/indexed_db/indexed_db_key_path.h" 19 #include "content/common/indexed_db/indexed_db_key_path.h"
20 #include "url/gurl.h" 20 #include "url/gurl.h"
21 21
22 namespace content { 22 namespace content {
23 class IndexedDBConnection; 23 class IndexedDBConnection;
24 class IndexedDBCursor; 24 class IndexedDBCursor;
25 class IndexedDBDatabase; 25 class IndexedDBDatabase;
26 class IndexedDBDatabaseCallbacks; 26 class IndexedDBDatabaseCallbacks;
27 struct IndexedDBDatabaseMetadata; 27 struct IndexedDBDatabaseMetadata;
28 struct IndexedDBValue;
28 29
29 class CONTENT_EXPORT IndexedDBCallbacks 30 class CONTENT_EXPORT IndexedDBCallbacks
30 : public base::RefCounted<IndexedDBCallbacks> { 31 : public base::RefCounted<IndexedDBCallbacks> {
31 public: 32 public:
32 // Simple payload responses 33 // Simple payload responses
33 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host, 34 IndexedDBCallbacks(IndexedDBDispatcherHost* dispatcher_host,
34 int32 ipc_thread_id, 35 int32 ipc_thread_id,
35 int32 ipc_callbacks_id); 36 int32 ipc_callbacks_id);
36 37
37 // IndexedDBCursor responses 38 // IndexedDBCursor responses
(...skipping 25 matching lines...) Expand all
63 int64 old_version, 64 int64 old_version,
64 scoped_ptr<IndexedDBConnection> connection, 65 scoped_ptr<IndexedDBConnection> connection,
65 const content::IndexedDBDatabaseMetadata& metadata); 66 const content::IndexedDBDatabaseMetadata& metadata);
66 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, 67 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection,
67 const content::IndexedDBDatabaseMetadata& metadata); 68 const content::IndexedDBDatabaseMetadata& metadata);
68 69
69 // IndexedDBDatabase::OpenCursor 70 // IndexedDBDatabase::OpenCursor
70 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor, 71 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
71 const IndexedDBKey& key, 72 const IndexedDBKey& key,
72 const IndexedDBKey& primary_key, 73 const IndexedDBKey& primary_key,
73 std::string* value); 74 IndexedDBValue* value);
74 75
75 // IndexedDBCursor::Continue / Advance 76 // IndexedDBCursor::Continue / Advance
76 virtual void OnSuccess(const IndexedDBKey& key, 77 virtual void OnSuccess(const IndexedDBKey& key,
77 const IndexedDBKey& primary_key, 78 const IndexedDBKey& primary_key,
78 std::string* value); 79 IndexedDBValue* value);
79 80
80 // IndexedDBCursor::PrefetchContinue 81 // IndexedDBCursor::PrefetchContinue
81 virtual void OnSuccessWithPrefetch( 82 virtual void OnSuccessWithPrefetch(
82 const std::vector<IndexedDBKey>& keys, 83 const std::vector<IndexedDBKey>& keys,
83 const std::vector<IndexedDBKey>& primary_keys, 84 const std::vector<IndexedDBKey>& primary_keys,
84 const std::vector<std::string>& values); 85 std::vector<IndexedDBValue>& values);
cmumford 2014/03/14 00:36:16 Same question about const removal here.
ericu 2014/03/14 01:17:23 Done.
85 86
86 // IndexedDBDatabase::Get (with key injection) 87 // IndexedDBDatabase::Get (with key injection)
87 virtual void OnSuccess(std::string* data, 88 virtual void OnSuccess(IndexedDBValue* value,
88 const IndexedDBKey& key, 89 const IndexedDBKey& key,
89 const IndexedDBKeyPath& key_path); 90 const IndexedDBKeyPath& key_path);
90 91
91 // IndexedDBDatabase::Get 92 // IndexedDBDatabase::Get
92 virtual void OnSuccess(std::string* value); 93 virtual void OnSuccess(IndexedDBValue* value);
93 94
94 // IndexedDBDatabase::Put / IndexedDBCursor::Update 95 // IndexedDBDatabase::Put / IndexedDBCursor::Update
95 virtual void OnSuccess(const IndexedDBKey& value); 96 virtual void OnSuccess(const IndexedDBKey& key);
96 97
97 // IndexedDBDatabase::Count 98 // IndexedDBDatabase::Count
98 virtual void OnSuccess(int64 value); 99 virtual void OnSuccess(int64 value);
99 100
100 // IndexedDBDatabase::Delete 101 // IndexedDBDatabase::Delete
101 // IndexedDBCursor::Continue / Advance (when complete) 102 // IndexedDBCursor::Continue / Advance (when complete)
102 virtual void OnSuccess(); 103 virtual void OnSuccess();
103 104
104 blink::WebIDBDataLoss data_loss() const { return data_loss_; } 105 blink::WebIDBDataLoss data_loss() const { return data_loss_; }
105 106
(...skipping 18 matching lines...) Expand all
124 int32 ipc_database_callbacks_id_; 125 int32 ipc_database_callbacks_id_;
125 126
126 // Stored in OnDataLoss, merged with OnUpgradeNeeded response. 127 // Stored in OnDataLoss, merged with OnUpgradeNeeded response.
127 blink::WebIDBDataLoss data_loss_; 128 blink::WebIDBDataLoss data_loss_;
128 std::string data_loss_message_; 129 std::string data_loss_message_;
129 }; 130 };
130 131
131 } // namespace content 132 } // namespace content
132 133
133 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ 134 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698