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

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

Issue 16870007: Switch database/file_identifier to std::string, remove createFromDatabaseIdentifier calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 private: 188 private:
189 int64 database_id_; 189 int64 database_id_;
190 }; 190 };
191 191
192 class DatabaseNameKey { 192 class DatabaseNameKey {
193 public: 193 public:
194 static const char* Decode(const char* start, 194 static const char* Decode(const char* start,
195 const char* limit, 195 const char* limit,
196 DatabaseNameKey* result); 196 DatabaseNameKey* result);
197 CONTENT_EXPORT static std::vector<char> Encode(const string16& origin, 197 CONTENT_EXPORT static std::vector<char> Encode(
198 const string16& database_name); 198 const std::string& origin_identifier,
199 static std::vector<char> EncodeMinKeyForOrigin(const string16& origin); 199 const string16& database_name);
200 static std::vector<char> EncodeStopKeyForOrigin(const string16& origin); 200 static std::vector<char> EncodeMinKeyForOrigin(
201 const std::string& origin_identifier);
202 static std::vector<char> EncodeStopKeyForOrigin(
203 const std::string& origin_identifier);
201 string16 origin() const { return origin_; } 204 string16 origin() const { return origin_; }
202 string16 database_name() const { return database_name_; } 205 string16 database_name() const { return database_name_; }
203 int Compare(const DatabaseNameKey& other); 206 int Compare(const DatabaseNameKey& other);
204 207
205 private: 208 private:
206 string16 origin_; // TODO(jsbell): Store encoded strings, or just pointers. 209 string16 origin_; // TODO(jsbell): Store encoded strings, or just pointers.
207 string16 database_name_; 210 string16 database_name_;
208 }; 211 };
209 212
210 class DatabaseMetaDataKey { 213 class DatabaseMetaDataKey {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 static const char* Decode(const char* start, 333 static const char* Decode(const char* start,
331 const char* limit, 334 const char* limit,
332 ObjectStoreNamesKey* result); 335 ObjectStoreNamesKey* result);
333 CONTENT_EXPORT static std::vector<char> Encode( 336 CONTENT_EXPORT static std::vector<char> Encode(
334 int64 database_id, 337 int64 database_id,
335 const string16& object_store_name); 338 const string16& object_store_name);
336 int Compare(const ObjectStoreNamesKey& other); 339 int Compare(const ObjectStoreNamesKey& other);
337 string16 object_store_name() const { return object_store_name_; } 340 string16 object_store_name() const { return object_store_name_; }
338 341
339 private: 342 private:
340 string16 343 // TODO(jsbell): Store the encoded string, or just pointers to it.
341 object_store_name_; // TODO(jsbell): Store the encoded string, or just 344 string16 object_store_name_;
342 // pointers to it.
343 }; 345 };
344 346
345 class IndexNamesKey { 347 class IndexNamesKey {
346 public: 348 public:
347 IndexNamesKey(); 349 IndexNamesKey();
348 // TODO(jsbell): We never use this to look up index ids, because a mapping 350 // TODO(jsbell): We never use this to look up index ids, because a mapping
349 // is kept at a higher level. 351 // is kept at a higher level.
350 static const char* Decode(const char* start, 352 static const char* Decode(const char* start,
351 const char* limit, 353 const char* limit,
352 IndexNamesKey* result); 354 IndexNamesKey* result);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 std::vector<char> encoded_user_key_; 448 std::vector<char> encoded_user_key_;
447 std::vector<char> encoded_primary_key_; 449 std::vector<char> encoded_primary_key_;
448 int64 sequence_number_; 450 int64 sequence_number_;
449 451
450 DISALLOW_COPY_AND_ASSIGN(IndexDataKey); 452 DISALLOW_COPY_AND_ASSIGN(IndexDataKey);
451 }; 453 };
452 454
453 } // namespace content 455 } // namespace content
454 456
455 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_ 457 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_LEVELDB_CODING_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_fake_backing_store.h ('k') | content/browser/indexed_db/indexed_db_leveldb_coding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698