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

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

Issue 266333002: Add most of the metadata-handling code for blobs. It's not quite all there, but (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove debugging code; revert to approved version. Created 6 years, 7 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
« 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 28 matching lines...) Expand all
39 // 39 //
40 // Global metadata 40 // Global metadata
41 // --------------- 41 // ---------------
42 // The prefix is <0, 0, 0>, followed by a metadata type byte: 42 // The prefix is <0, 0, 0>, followed by a metadata type byte:
43 // 43 //
44 // <0, 0, 0, 0> => backing store schema version [SchemaVersionKey] 44 // <0, 0, 0, 0> => backing store schema version [SchemaVersionKey]
45 // <0, 0, 0, 1> => maximum allocated database [MaxDatabaseIdKey] 45 // <0, 0, 0, 1> => maximum allocated database [MaxDatabaseIdKey]
46 // <0, 0, 0, 2> => SerializedScriptValue version [DataVersionKey] 46 // <0, 0, 0, 2> => SerializedScriptValue version [DataVersionKey]
47 // <0, 0, 0, 3> 47 // <0, 0, 0, 3>
48 // => Blob journal 48 // => Blob journal
49 // The format of the journal is: {database_id, blobKey}*. 49 // The format of the journal is:
50 // {database_id (var int), blobKey (var int)}*.
50 // If the blobKey is kAllBlobsKey, the whole database should be deleted. 51 // If the blobKey is kAllBlobsKey, the whole database should be deleted.
51 // [BlobJournalKey] 52 // [BlobJournalKey]
52 // <0, 0, 0, 4> => Live blob journal; same format. [LiveBlobJournalKey] 53 // <0, 0, 0, 4> => Live blob journal; same format. [LiveBlobJournalKey]
53 // <0, 0, 0, 100, database id> 54 // <0, 0, 0, 100, database id>
54 // => Existence implies the database id is in the free list 55 // => Existence implies the database id is in the free list
55 // [DatabaseFreeListKey] 56 // [DatabaseFreeListKey]
56 // <0, 0, 0, 201, origin, database name> => Database id [DatabaseNameKey] 57 // <0, 0, 0, 201, origin, database name> => Database id [DatabaseNameKey]
57 // 58 //
58 // 59 //
59 // Database metadata: [DatabaseMetaDataKey] 60 // Database metadata: [DatabaseMetaDataKey]
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const { 2030 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const {
2030 scoped_ptr<IndexedDBKey> key; 2031 scoped_ptr<IndexedDBKey> key;
2031 StringPiece slice(encoded_primary_key_); 2032 StringPiece slice(encoded_primary_key_);
2032 if (!DecodeIDBKey(&slice, &key)) { 2033 if (!DecodeIDBKey(&slice, &key)) {
2033 // TODO(jsbell): Return error. 2034 // TODO(jsbell): Return error.
2034 } 2035 }
2035 return key.Pass(); 2036 return key.Pass();
2036 } 2037 }
2037 2038
2038 } // 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