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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBKey.h

Issue 2676403003: IndexedDB: Add histograms for key type (Closed)
Patch Set: Tweak include orders, maybe? Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 static IDBKey* createDate(double date) { return new IDBKey(DateType, date); } 56 static IDBKey* createDate(double date) { return new IDBKey(DateType, date); }
57 57
58 static IDBKey* createArray(const KeyArray& array) { 58 static IDBKey* createArray(const KeyArray& array) {
59 return new IDBKey(array); 59 return new IDBKey(array);
60 } 60 }
61 61
62 ~IDBKey(); 62 ~IDBKey();
63 DECLARE_TRACE(); 63 DECLARE_TRACE();
64 64
65 // In order of the least to the highest precedent in terms of sort order. 65 // In order of the least to the highest precedent in terms of sort order.
66 // These values are written to logs. New enum values can be added, but
67 // existing enums must never be renumbered or deleted and reused.
66 enum Type { 68 enum Type {
67 InvalidType = 0, 69 InvalidType = 0,
68 ArrayType, 70 ArrayType = 1,
69 BinaryType, 71 BinaryType = 2,
70 StringType, 72 StringType = 3,
71 DateType, 73 DateType = 4,
72 NumberType, 74 NumberType = 5,
73 MinType 75 TypeEnumMax = 6,
Mark P 2017/02/07 22:59:46 nit: leave max unassigned; it will default to 6.
74 }; 76 };
75 77
76 Type getType() const { return m_type; } 78 Type getType() const { return m_type; }
77 bool isValid() const; 79 bool isValid() const;
78 80
79 const KeyArray& array() const { 81 const KeyArray& array() const {
80 ASSERT(m_type == ArrayType); 82 ASSERT(m_type == ArrayType);
81 return m_array; 83 return m_array;
82 } 84 }
83 85
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 const Type m_type; 122 const Type m_type;
121 const KeyArray m_array; 123 const KeyArray m_array;
122 RefPtr<SharedBuffer> m_binary; 124 RefPtr<SharedBuffer> m_binary;
123 const String m_string; 125 const String m_string;
124 const double m_number = 0; 126 const double m_number = 0;
125 }; 127 };
126 128
127 } // namespace blink 129 } // namespace blink
128 130
129 #endif // IDBKey_h 131 #endif // IDBKey_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698