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

Unified Diff: Source/web/WebIDBKey.cpp

Issue 19316002: Separate WebIDBKey type into separate header (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/WebIDBKey.cpp
diff --git a/Source/web/WebIDBKey.cpp b/Source/web/WebIDBKey.cpp
index 35d82fdfd64b1935b596209ccd8caf992c0aff10..fabaaab70a09a814d1e01c0c45f747b3900ae777 100644
--- a/Source/web/WebIDBKey.cpp
+++ b/Source/web/WebIDBKey.cpp
@@ -86,24 +86,24 @@ static PassRefPtr<IDBKey> convertFromWebIDBKeyArray(const WebVector<WebIDBKey>&
IDBKey::KeyArray keys;
keys.reserveCapacity(array.size());
for (size_t i = 0; i < array.size(); ++i) {
- switch (array[i].type()) {
- case WebIDBKey::ArrayType:
+ switch (array[i].keyType()) {
+ case WebIDBKeyTypeArray:
keys.append(convertFromWebIDBKeyArray(array[i].array()));
break;
- case WebIDBKey::StringType:
+ case WebIDBKeyTypeString:
keys.append(IDBKey::createString(array[i].string()));
break;
- case WebIDBKey::DateType:
+ case WebIDBKeyTypeDate:
keys.append(IDBKey::createDate(array[i].date()));
break;
- case WebIDBKey::NumberType:
+ case WebIDBKeyTypeNumber:
keys.append(IDBKey::createNumber(array[i].number()));
break;
- case WebIDBKey::InvalidType:
+ case WebIDBKeyTypeInvalid:
keys.append(IDBKey::createInvalid());
break;
- case WebIDBKey::NullType:
- case WebIDBKey::MinType:
+ case WebIDBKeyTypeNull:
+ case WebIDBKeyTypeMin:
ASSERT_NOT_REACHED();
break;
}
@@ -177,6 +177,13 @@ void WebIDBKey::reset()
m_private.reset();
}
+WebIDBKeyType WebIDBKey::keyType() const
+{
+ if (!m_private.get())
+ return WebIDBKeyType::WebIDBKeyTypeNull;
+ return static_cast<WebIDBKeyType>(m_private->type());
+}
+
WebIDBKey::Type WebIDBKey::type() const
{
if (!m_private.get())

Powered by Google App Engine
This is Rietveld 408576698