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

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

Issue 373873002: Fixes for re-enabling more MSVC level 4 warnings: content/browser/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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) 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 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 1429
1430 std::string DatabaseMetaDataKey::Encode(int64 database_id, 1430 std::string DatabaseMetaDataKey::Encode(int64 database_id,
1431 MetaDataType meta_data_type) { 1431 MetaDataType meta_data_type) {
1432 KeyPrefix prefix(database_id); 1432 KeyPrefix prefix(database_id);
1433 std::string ret = prefix.Encode(); 1433 std::string ret = prefix.Encode();
1434 ret.push_back(meta_data_type); 1434 ret.push_back(meta_data_type);
1435 return ret; 1435 return ret;
1436 } 1436 }
1437 1437
1438 ObjectStoreMetaDataKey::ObjectStoreMetaDataKey() 1438 ObjectStoreMetaDataKey::ObjectStoreMetaDataKey()
1439 : object_store_id_(-1), meta_data_type_(-1) {} 1439 : object_store_id_(-1), meta_data_type_(0xFF) {}
1440 1440
1441 bool ObjectStoreMetaDataKey::Decode(StringPiece* slice, 1441 bool ObjectStoreMetaDataKey::Decode(StringPiece* slice,
1442 ObjectStoreMetaDataKey* result) { 1442 ObjectStoreMetaDataKey* result) {
1443 KeyPrefix prefix; 1443 KeyPrefix prefix;
1444 if (!KeyPrefix::Decode(slice, &prefix)) 1444 if (!KeyPrefix::Decode(slice, &prefix))
1445 return false; 1445 return false;
1446 DCHECK(prefix.database_id_); 1446 DCHECK(prefix.database_id_);
1447 DCHECK(!prefix.object_store_id_); 1447 DCHECK(!prefix.object_store_id_);
1448 DCHECK(!prefix.index_id_); 1448 DCHECK(!prefix.index_id_);
1449 unsigned char type_byte = 0; 1449 unsigned char type_byte = 0;
(...skipping 580 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

Powered by Google App Engine
This is Rietveld 408576698