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

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

Issue 119343004: IndexedDB: Simplify data loss code/message routing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl format Created 7 years 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_callbacks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 virtual void OnError(const IndexedDBDatabaseError& error); 51 virtual void OnError(const IndexedDBDatabaseError& error);
52 52
53 // IndexedDBFactory::GetDatabaseNames 53 // IndexedDBFactory::GetDatabaseNames
54 virtual void OnSuccess(const std::vector<base::string16>& string); 54 virtual void OnSuccess(const std::vector<base::string16>& string);
55 55
56 // IndexedDBFactory::Open / DeleteDatabase 56 // IndexedDBFactory::Open / DeleteDatabase
57 virtual void OnBlocked(int64 existing_version); 57 virtual void OnBlocked(int64 existing_version);
58 58
59 // IndexedDBFactory::Open 59 // IndexedDBFactory::Open
60 virtual void OnDataLoss(blink::WebIDBDataLoss data_loss,
61 std::string data_loss_message);
60 virtual void OnUpgradeNeeded( 62 virtual void OnUpgradeNeeded(
61 int64 old_version, 63 int64 old_version,
62 scoped_ptr<IndexedDBConnection> connection, 64 scoped_ptr<IndexedDBConnection> connection,
63 const content::IndexedDBDatabaseMetadata& metadata, 65 const content::IndexedDBDatabaseMetadata& metadata);
64 blink::WebIDBDataLoss data_loss,
65 std::string data_loss_message);
66 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection, 66 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection,
67 const content::IndexedDBDatabaseMetadata& metadata); 67 const content::IndexedDBDatabaseMetadata& metadata);
68 68
69 // IndexedDBDatabase::OpenCursor 69 // IndexedDBDatabase::OpenCursor
70 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor, 70 virtual void OnSuccess(scoped_refptr<IndexedDBCursor> cursor,
71 const IndexedDBKey& key, 71 const IndexedDBKey& key,
72 const IndexedDBKey& primary_key, 72 const IndexedDBKey& primary_key,
73 std::string* value); 73 std::string* value);
74 74
75 // IndexedDBCursor::Continue / Advance 75 // IndexedDBCursor::Continue / Advance
(...skipping 18 matching lines...) Expand all
94 // IndexedDBDatabase::Put / IndexedDBCursor::Update 94 // IndexedDBDatabase::Put / IndexedDBCursor::Update
95 virtual void OnSuccess(const IndexedDBKey& value); 95 virtual void OnSuccess(const IndexedDBKey& value);
96 96
97 // IndexedDBDatabase::Count 97 // IndexedDBDatabase::Count
98 virtual void OnSuccess(int64 value); 98 virtual void OnSuccess(int64 value);
99 99
100 // IndexedDBDatabase::Delete 100 // IndexedDBDatabase::Delete
101 // IndexedDBCursor::Continue / Advance (when complete) 101 // IndexedDBCursor::Continue / Advance (when complete)
102 virtual void OnSuccess(); 102 virtual void OnSuccess();
103 103
104 blink::WebIDBDataLoss data_loss() const { return data_loss_; }
105
104 protected: 106 protected:
105 virtual ~IndexedDBCallbacks(); 107 virtual ~IndexedDBCallbacks();
106 108
107 private: 109 private:
108 friend class base::RefCounted<IndexedDBCallbacks>; 110 friend class base::RefCounted<IndexedDBCallbacks>;
109 111
110 // Originally from IndexedDBCallbacks: 112 // Originally from IndexedDBCallbacks:
111 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 113 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
112 int32 ipc_callbacks_id_; 114 int32 ipc_callbacks_id_;
113 int32 ipc_thread_id_; 115 int32 ipc_thread_id_;
114 116
115 // IndexedDBCursor callbacks ------------------------ 117 // IndexedDBCursor callbacks ------------------------
116 int32 ipc_cursor_id_; 118 int32 ipc_cursor_id_;
117 119
118 // IndexedDBDatabase callbacks ------------------------ 120 // IndexedDBDatabase callbacks ------------------------
119 int64 host_transaction_id_; 121 int64 host_transaction_id_;
120 GURL origin_url_; 122 GURL origin_url_;
121 int32 ipc_database_id_; 123 int32 ipc_database_id_;
122 int32 ipc_database_callbacks_id_; 124 int32 ipc_database_callbacks_id_;
125
126 // Stored in OnDataLoss, merged with OnUpgradeNeeded response.
127 blink::WebIDBDataLoss data_loss_;
128 std::string data_loss_message_;
123 }; 129 };
124 130
125 } // namespace content 131 } // namespace content
126 132
127 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ 133 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698