summaryrefslogtreecommitdiffstats
path: root/chrome/common/indexed_db_key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/indexed_db_key.cc')
-rw-r--r--chrome/common/indexed_db_key.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/common/indexed_db_key.cc b/chrome/common/indexed_db_key.cc
index 31a9386..315e5b2 100644
--- a/chrome/common/indexed_db_key.cc
+++ b/chrome/common/indexed_db_key.cc
@@ -14,11 +14,8 @@ IndexedDBKey::IndexedDBKey()
number_(0) {
}
-IndexedDBKey::IndexedDBKey(const WebIDBKey& key)
- : type_(key.type()),
- string_(key.type() == WebIDBKey::StringType
- ? static_cast<string16>(key.string()) : string16()),
- number_(key.type() == WebIDBKey::NumberType ? key.number() : 0) {
+IndexedDBKey::IndexedDBKey(const WebIDBKey& key) {
+ Set(key);
}
void IndexedDBKey::SetNull() {
@@ -39,6 +36,13 @@ void IndexedDBKey::Set(int32_t number) {
number_ = number;
}
+void IndexedDBKey::Set(const WebIDBKey& key) {
+ type_ = key.type();
+ string_ = key.type() == WebIDBKey::StringType ?
+ static_cast<string16>(key.string()) : string16();
+ number_ = key.type() == WebIDBKey::NumberType ? key.number() : 0;
+}
+
IndexedDBKey::operator WebIDBKey() const {
switch (type_) {
case WebIDBKey::NullType: