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

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

Issue 2676403003: IndexedDB: Add histograms for key type (Closed)
Patch Set: Leave number off enum max 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 memcmp(m_binary->data(), other->m_binary->data(), 76 memcmp(m_binary->data(), other->m_binary->data(),
77 std::min(m_binary->size(), other->m_binary->size()))) 77 std::min(m_binary->size(), other->m_binary->size())))
78 return result < 0 ? -1 : 1; 78 return result < 0 ? -1 : 1;
79 return compareNumbers(m_binary->size(), other->m_binary->size()); 79 return compareNumbers(m_binary->size(), other->m_binary->size());
80 case StringType: 80 case StringType:
81 return codePointCompare(m_string, other->m_string); 81 return codePointCompare(m_string, other->m_string);
82 case DateType: 82 case DateType:
83 case NumberType: 83 case NumberType:
84 return compareNumbers(m_number, other->m_number); 84 return compareNumbers(m_number, other->m_number);
85 case InvalidType: 85 case InvalidType:
86 case MinType: 86 case TypeEnumMax:
87 ASSERT_NOT_REACHED(); 87 ASSERT_NOT_REACHED();
88 return 0; 88 return 0;
89 } 89 }
90 90
91 ASSERT_NOT_REACHED(); 91 ASSERT_NOT_REACHED();
92 return 0; 92 return 0;
93 } 93 }
94 94
95 bool IDBKey::isLessThan(const IDBKey* other) const { 95 bool IDBKey::isLessThan(const IDBKey* other) const {
96 ASSERT(other); 96 ASSERT(other);
(...skipping 20 matching lines...) Expand all
117 [](const Member<IDBKey> a, const Member<IDBKey> b) { 117 [](const Member<IDBKey> a, const Member<IDBKey> b) {
118 return a->isLessThan(b); 118 return a->isLessThan(b);
119 }); 119 });
120 const auto end = std::unique(result.begin(), result.end()); 120 const auto end = std::unique(result.begin(), result.end());
121 DCHECK_LE(static_cast<size_t>(end - result.begin()), result.size()); 121 DCHECK_LE(static_cast<size_t>(end - result.begin()), result.size());
122 result.resize(end - result.begin()); 122 result.resize(end - result.begin());
123 return result; 123 return result;
124 } 124 }
125 125
126 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBKey.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698