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

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

Issue 2676403003: IndexedDB: Add histograms for key type (Closed)
Patch Set: Record index key types too 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 // Also used for UMA. Append only.
Mark P 2017/02/07 19:12:22 Please follow the comments and = guidelines here.
jsbell 2017/02/07 19:54:56 Done.
66 enum Type { 67 enum Type {
67 InvalidType = 0, 68 InvalidType = 0,
68 ArrayType, 69 ArrayType,
69 BinaryType, 70 BinaryType,
70 StringType, 71 StringType,
71 DateType, 72 DateType,
72 NumberType, 73 NumberType,
73 MinType 74 TypeEnumMax = NumberType
74 }; 75 };
75 76
76 Type getType() const { return m_type; } 77 Type getType() const { return m_type; }
77 bool isValid() const; 78 bool isValid() const;
78 79
79 const KeyArray& array() const { 80 const KeyArray& array() const {
80 ASSERT(m_type == ArrayType); 81 ASSERT(m_type == ArrayType);
81 return m_array; 82 return m_array;
82 } 83 }
83 84
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 const Type m_type; 121 const Type m_type;
121 const KeyArray m_array; 122 const KeyArray m_array;
122 RefPtr<SharedBuffer> m_binary; 123 RefPtr<SharedBuffer> m_binary;
123 const String m_string; 124 const String m_string;
124 const double m_number = 0; 125 const double m_number = 0;
125 }; 126 };
126 127
127 } // namespace blink 128 } // namespace blink
128 129
129 #endif // IDBKey_h 130 #endif // IDBKey_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698