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

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

Issue 536463002: IndexedDB: Decode correct int type for database name->id map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.cc ('k') | no next file » | 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) 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_leveldb_coding.h" 5 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // <0, 0, 0, 3> 47 // <0, 0, 0, 3>
48 // => Blob journal 48 // => Blob journal
49 // The format of the journal is: 49 // The format of the journal is:
50 // {database_id (var int), blobKey (var int)}*. 50 // {database_id (var int), blobKey (var int)}*.
51 // If the blobKey is kAllBlobsKey, the whole database should be deleted. 51 // If the blobKey is kAllBlobsKey, the whole database should be deleted.
52 // [BlobJournalKey] 52 // [BlobJournalKey]
53 // <0, 0, 0, 4> => Live blob journal; same format. [LiveBlobJournalKey] 53 // <0, 0, 0, 4> => Live blob journal; same format. [LiveBlobJournalKey]
54 // <0, 0, 0, 100, database id> 54 // <0, 0, 0, 100, database id>
55 // => Existence implies the database id is in the free list 55 // => Existence implies the database id is in the free list
56 // [DatabaseFreeListKey] 56 // [DatabaseFreeListKey]
57 // <0, 0, 0, 201, origin, database name> => Database id [DatabaseNameKey] 57 // <0, 0, 0, 201, origin, database name> => Database id (int) [DatabaseNameKey]
58 // 58 //
59 // 59 //
60 // Database metadata: [DatabaseMetaDataKey] 60 // Database metadata: [DatabaseMetaDataKey]
61 // ---------------------------------------- 61 // ----------------------------------------
62 // The prefix is <database id, 0, 0> followed by a metadata type byte: 62 // The prefix is <database id, 0, 0> followed by a metadata type byte:
63 // 63 //
64 // <database id, 0, 0, 0> => origin name 64 // <database id, 0, 0, 0> => origin name
65 // <database id, 0, 0, 1> => database name 65 // <database id, 0, 0, 1> => database name
66 // <database id, 0, 0, 2> => IDB string version data (obsolete) 66 // <database id, 0, 0, 2> => IDB string version data (obsolete)
67 // <database id, 0, 0, 3> => maximum allocated object store id 67 // <database id, 0, 0, 3> => maximum allocated object store id
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const { 2030 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const {
2031 scoped_ptr<IndexedDBKey> key; 2031 scoped_ptr<IndexedDBKey> key;
2032 StringPiece slice(encoded_primary_key_); 2032 StringPiece slice(encoded_primary_key_);
2033 if (!DecodeIDBKey(&slice, &key)) { 2033 if (!DecodeIDBKey(&slice, &key)) {
2034 // TODO(jsbell): Return error. 2034 // TODO(jsbell): Return error.
2035 } 2035 }
2036 return key.Pass(); 2036 return key.Pass();
2037 } 2037 }
2038 2038
2039 } // namespace content 2039 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698