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

Side by Side Diff: content/common/indexed_db/indexed_db_struct_traits.cc

Issue 2773823002: Use a two-part data format version in IndexedDB metadata. (Closed)
Patch Set: partially revert test change Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/indexed_db/indexed_db_struct_traits.h" 5 #include "content/common/indexed_db/indexed_db_struct_traits.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "mojo/common/common_custom_types_struct_traits.h" 8 #include "mojo/common/common_custom_types_struct_traits.h"
9 9
10 using content::IndexedDBKey; 10 using content::IndexedDBKey;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 DCHECK(!base::ContainsKey(out->object_stores, object_store.id())); 239 DCHECK(!base::ContainsKey(out->object_stores, object_store.id()));
240 if (!StructTraits<indexed_db::mojom::ObjectStoreMetadataDataView, 240 if (!StructTraits<indexed_db::mojom::ObjectStoreMetadataDataView,
241 content::IndexedDBObjectStoreMetadata>:: 241 content::IndexedDBObjectStoreMetadata>::
242 Read(object_store, &out->object_stores[object_store.id()])) 242 Read(object_store, &out->object_stores[object_store.id()]))
243 return false; 243 return false;
244 } 244 }
245 return true; 245 return true;
246 } 246 }
247 247
248 // static 248 // static
249 bool StructTraits<indexed_db::mojom::DataFormatVersionDataView,
250 content::IndexedDBDataFormatVersion>::
251 Read(indexed_db::mojom::DataFormatVersionDataView data,
252 content::IndexedDBDataFormatVersion* out) {
253 *out = content::IndexedDBDataFormatVersion(data.v8_version(),
254 data.blink_version());
255 return true;
256 };
cmumford 2017/04/03 16:55:02 Delete semicolon.
jbroman 2017/04/04 18:50:38 Done.
257
258 // static
249 CursorDirection 259 CursorDirection
250 EnumTraits<CursorDirection, blink::WebIDBCursorDirection>::ToMojom( 260 EnumTraits<CursorDirection, blink::WebIDBCursorDirection>::ToMojom(
251 blink::WebIDBCursorDirection input) { 261 blink::WebIDBCursorDirection input) {
252 switch (input) { 262 switch (input) {
253 case blink::WebIDBCursorDirectionNext: 263 case blink::WebIDBCursorDirectionNext:
254 return CursorDirection::Next; 264 return CursorDirection::Next;
255 case blink::WebIDBCursorDirectionNextNoDuplicate: 265 case blink::WebIDBCursorDirectionNextNoDuplicate:
256 return CursorDirection::NextNoDuplicate; 266 return CursorDirection::NextNoDuplicate;
257 case blink::WebIDBCursorDirectionPrev: 267 case blink::WebIDBCursorDirectionPrev:
258 return CursorDirection::Prev; 268 return CursorDirection::Prev;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 case TransactionMode::ReadWrite: 451 case TransactionMode::ReadWrite:
442 *output = blink::WebIDBTransactionModeReadWrite; 452 *output = blink::WebIDBTransactionModeReadWrite;
443 return true; 453 return true;
444 case TransactionMode::VersionChange: 454 case TransactionMode::VersionChange:
445 *output = blink::WebIDBTransactionModeVersionChange; 455 *output = blink::WebIDBTransactionModeVersionChange;
446 return true; 456 return true;
447 } 457 }
448 return false; 458 return false;
449 } 459 }
450 } // namespace mojo 460 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698