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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_callbacks.cc

Issue 17033004: Tell IDB frontend about data loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debug Created 7 years, 6 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 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" 5 #include "content/browser/in_process_webkit/indexed_db_callbacks.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/browser/indexed_db/indexed_db_metadata.h" 10 #include "content/browser/indexed_db/indexed_db_metadata.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 void IndexedDBCallbacksBase::onSuccess( 48 void IndexedDBCallbacksBase::onSuccess(
49 WebIDBDatabaseImpl* idb_object, 49 WebIDBDatabaseImpl* idb_object,
50 const IndexedDBDatabaseMetadata& metadata) { 50 const IndexedDBDatabaseMetadata& metadata) {
51 NOTREACHED(); 51 NOTREACHED();
52 } 52 }
53 53
54 void IndexedDBCallbacksBase::onUpgradeNeeded(long long old_version, 54 void IndexedDBCallbacksBase::onUpgradeNeeded(long long old_version,
55 WebIDBDatabaseImpl* database, 55 WebIDBDatabaseImpl* database,
56 const IndexedDBDatabaseMetadata&) { 56 const IndexedDBDatabaseMetadata&,
57 bool data_loss) {
57 NOTREACHED(); 58 NOTREACHED();
58 } 59 }
59 60
60 void IndexedDBCallbacksBase::onSuccess(WebIDBCursorImpl* idb_object, 61 void IndexedDBCallbacksBase::onSuccess(WebIDBCursorImpl* idb_object,
61 const IndexedDBKey& key, 62 const IndexedDBKey& key,
62 const IndexedDBKey& primaryKey, 63 const IndexedDBKey& primaryKey,
63 std::vector<char>* value) { 64 std::vector<char>* value) {
64 NOTREACHED(); 65 NOTREACHED();
65 } 66 }
66 67
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 new IndexedDBMsg_CallbacksSuccessIDBDatabase(ipc_thread_id(), 127 new IndexedDBMsg_CallbacksSuccessIDBDatabase(ipc_thread_id(),
127 ipc_callbacks_id(), 128 ipc_callbacks_id(),
128 ipc_database_callbacks_id_, 129 ipc_database_callbacks_id_,
129 ipc_object_id, 130 ipc_object_id,
130 idb_metadata)); 131 idb_metadata));
131 } 132 }
132 133
133 void IndexedDBCallbacksDatabase::onUpgradeNeeded( 134 void IndexedDBCallbacksDatabase::onUpgradeNeeded(
134 long long old_version, 135 long long old_version,
135 WebIDBDatabaseImpl* database, 136 WebIDBDatabaseImpl* database,
136 const IndexedDBDatabaseMetadata& metadata) { 137 const IndexedDBDatabaseMetadata& metadata,
138 bool data_loss) {
137 dispatcher_host()->RegisterTransactionId(host_transaction_id_, origin_url_); 139 dispatcher_host()->RegisterTransactionId(host_transaction_id_, origin_url_);
138 int32 ipc_database_id = 140 int32 ipc_database_id =
139 dispatcher_host()->Add(database, ipc_thread_id(), origin_url_); 141 dispatcher_host()->Add(database, ipc_thread_id(), origin_url_);
140 ipc_database_id_ = ipc_database_id; 142 ipc_database_id_ = ipc_database_id;
141 IndexedDBMsg_CallbacksUpgradeNeeded_Params params; 143 IndexedDBMsg_CallbacksUpgradeNeeded_Params params;
142 params.ipc_thread_id = ipc_thread_id(); 144 params.ipc_thread_id = ipc_thread_id();
143 params.ipc_callbacks_id = ipc_callbacks_id(); 145 params.ipc_callbacks_id = ipc_callbacks_id();
144 params.ipc_database_id = ipc_database_id; 146 params.ipc_database_id = ipc_database_id;
145 params.ipc_database_callbacks_id = ipc_database_callbacks_id_; 147 params.ipc_database_callbacks_id = ipc_database_callbacks_id_;
146 params.old_version = old_version; 148 params.old_version = old_version;
147 params.idb_metadata = IndexedDBDispatcherHost::ConvertMetadata(metadata); 149 params.idb_metadata = IndexedDBDispatcherHost::ConvertMetadata(metadata);
150 params.data_loss = data_loss;
148 dispatcher_host()->Send(new IndexedDBMsg_CallbacksUpgradeNeeded(params)); 151 dispatcher_host()->Send(new IndexedDBMsg_CallbacksUpgradeNeeded(params));
149 } 152 }
150 153
151 void IndexedDBCallbacks<WebIDBCursorImpl>::onSuccess( 154 void IndexedDBCallbacks<WebIDBCursorImpl>::onSuccess(
152 WebIDBCursorImpl* idb_cursor, 155 WebIDBCursorImpl* idb_cursor,
153 const IndexedDBKey& key, 156 const IndexedDBKey& key,
154 const IndexedDBKey& primaryKey, 157 const IndexedDBKey& primaryKey,
155 std::vector<char>* value) { 158 std::vector<char>* value) {
156 int32 ipc_object_id = dispatcher_host()->Add(idb_cursor); 159 int32 ipc_object_id = dispatcher_host()->Add(idb_cursor);
157 IndexedDBMsg_CallbacksSuccessIDBCursor_Params params; 160 IndexedDBMsg_CallbacksSuccessIDBCursor_Params params;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 ipc_thread_id(), ipc_callbacks_id())); 285 ipc_thread_id(), ipc_callbacks_id()));
283 } 286 }
284 287
285 void IndexedDBCallbacks<std::vector<char> >::onSuccess( 288 void IndexedDBCallbacks<std::vector<char> >::onSuccess(
286 const IndexedDBKey& value) { 289 const IndexedDBKey& value) {
287 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessIndexedDBKey( 290 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessIndexedDBKey(
288 ipc_thread_id(), ipc_callbacks_id(), value)); 291 ipc_thread_id(), ipc_callbacks_id(), value));
289 } 292 }
290 293
291 } // namespace content 294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698