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

Unified Diff: content/browser/indexed_db/indexed_db_leveldb_coding.h

Issue 475063004: IndexedDB + Coding Style: re-order enums/typedefs/... to match guide (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore CONTENT_EXPORT to Transaction Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_leveldb_coding.h
diff --git a/content/browser/indexed_db/indexed_db_leveldb_coding.h b/content/browser/indexed_db/indexed_db_leveldb_coding.h
index 85bc091b56ba916db9c85826d507adc2040b9bcc..412ff163487fd17a507e4777bb34a28301a9b417 100644
--- a/content/browser/indexed_db/indexed_db_leveldb_coding.h
+++ b/content/browser/indexed_db/indexed_db_leveldb_coding.h
@@ -90,19 +90,6 @@ CONTENT_EXPORT int Compare(const base::StringPiece& a,
class KeyPrefix {
public:
- KeyPrefix();
- explicit KeyPrefix(int64 database_id);
- KeyPrefix(int64 database_id, int64 object_store_id);
- KeyPrefix(int64 database_id, int64 object_store_id, int64 index_id);
- static KeyPrefix CreateWithSpecialIndex(int64 database_id,
- int64 object_store_id,
- int64 index_id);
-
- static bool Decode(base::StringPiece* slice, KeyPrefix* result);
- std::string Encode() const;
- static std::string EncodeEmpty();
- int Compare(const KeyPrefix& other) const;
-
// These are serialized to disk; any new items must be appended, and none can
// be deleted.
enum Type {
@@ -138,6 +125,21 @@ class KeyPrefix {
static const int64 kMaxIndexId =
(1ULL << kMaxIndexIdBits) - 1; // max signed int32
+ static const int64 kInvalidId = -1;
+
+ KeyPrefix();
+ explicit KeyPrefix(int64 database_id);
+ KeyPrefix(int64 database_id, int64 object_store_id);
+ KeyPrefix(int64 database_id, int64 object_store_id, int64 index_id);
+ static KeyPrefix CreateWithSpecialIndex(int64 database_id,
+ int64 object_store_id,
+ int64 index_id);
+
+ static bool Decode(base::StringPiece* slice, KeyPrefix* result);
+ std::string Encode() const;
+ static std::string EncodeEmpty();
+ int Compare(const KeyPrefix& other) const;
+
CONTENT_EXPORT static bool IsValidDatabaseId(int64 database_id);
static bool IsValidObjectStoreId(int64 index_id);
static bool IsValidIndexId(int64 index_id);
@@ -158,17 +160,16 @@ class KeyPrefix {
int64 object_store_id_;
int64 index_id_;
- static const int64 kInvalidId = -1;
-
private:
- static std::string EncodeInternal(int64 database_id,
- int64 object_store_id,
- int64 index_id);
// Special constructor for CreateWithSpecialIndex()
KeyPrefix(enum Type,
int64 database_id,
int64 object_store_id,
int64 index_id);
+
+ static std::string EncodeInternal(int64 database_id,
+ int64 object_store_id,
+ int64 index_id);
};
class SchemaVersionKey {
@@ -378,6 +379,11 @@ class IndexNamesKey {
class ObjectStoreDataKey {
public:
+ static const int64 kSpecialIndexNumber;
+
+ ObjectStoreDataKey();
+ ~ObjectStoreDataKey();
+
static bool Decode(base::StringPiece* slice, ObjectStoreDataKey* result);
CONTENT_EXPORT static std::string Encode(int64 database_id,
int64 object_store_id,
@@ -386,16 +392,14 @@ class ObjectStoreDataKey {
int64 object_store_id,
const IndexedDBKey& user_key);
scoped_ptr<IndexedDBKey> user_key() const;
- static const int64 kSpecialIndexNumber;
- ObjectStoreDataKey();
- ~ObjectStoreDataKey();
-
private:
std::string encoded_user_key_;
};
class ExistsEntryKey {
public:
+ static const int64 kSpecialIndexNumber;
cmumford 2014/08/20 19:43:05 Unrelated to your change, but can be private? Same
jsbell 2014/08/22 20:50:01 Compiler says... 2/3 can be made private, another
+
ExistsEntryKey();
~ExistsEntryKey();
@@ -408,8 +412,6 @@ class ExistsEntryKey {
const IndexedDBKey& user_key);
scoped_ptr<IndexedDBKey> user_key() const;
- static const int64 kSpecialIndexNumber;
-
private:
std::string encoded_user_key_;
DISALLOW_COPY_AND_ASSIGN(ExistsEntryKey);
@@ -417,6 +419,8 @@ class ExistsEntryKey {
class BlobEntryKey {
public:
+ static const int64 kSpecialIndexNumber;
+
BlobEntryKey() : database_id_(0), object_store_id_(0) {}
static bool Decode(base::StringPiece* slice, BlobEntryKey* result);
static bool FromObjectStoreDataKey(base::StringPiece* slice,
@@ -433,8 +437,6 @@ class BlobEntryKey {
int64 database_id() const { return database_id_; }
int64 object_store_id() const { return object_store_id_; }
- static const int64 kSpecialIndexNumber;
-
private:
static std::string Encode(int64 database_id,
int64 object_store_id,

Powered by Google App Engine
This is Rietveld 408576698