diff options
author | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 23:09:08 +0000 |
---|---|---|
committer | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 23:09:08 +0000 |
commit | e1bcc0207442374ab4d539e6a5623fe4cf1fe8cb (patch) | |
tree | 01141ee8180a33ca0fba59379bf5d9e0f19c51db /content/common/indexed_db | |
parent | 71c1cbb0f63b371bc4167c9735e400457b376df2 (diff) | |
download | chromium_src-e1bcc0207442374ab4d539e6a5623fe4cf1fe8cb.zip chromium_src-e1bcc0207442374ab4d539e6a5623fe4cf1fe8cb.tar.gz chromium_src-e1bcc0207442374ab4d539e6a5623fe4cf1fe8cb.tar.bz2 |
Revert "Migrate the IndexedDB backend from Blink to Chromium"
This reverts commit 71c1cbb0f63b371bc4167c9735e400457b376df2.
Landed the wrong patch.
BUG=
TBR=jsbell
Review URL: https://codereview.chromium.org/15853013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/indexed_db')
-rw-r--r-- | content/common/indexed_db/indexed_db_key.cc | 30 | ||||
-rw-r--r-- | content/common/indexed_db/indexed_db_param_traits.cc | 18 |
2 files changed, 13 insertions, 35 deletions
diff --git a/content/common/indexed_db/indexed_db_key.cc b/content/common/indexed_db/indexed_db_key.cc index 3d24ade..4083fd3 100644 --- a/content/common/indexed_db/indexed_db_key.cc +++ b/content/common/indexed_db/indexed_db_key.cc @@ -4,7 +4,6 @@ #include "content/common/indexed_db/indexed_db_key.h" -#include <string> #include "base/logging.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebVector.h" @@ -61,7 +60,7 @@ static IndexedDBKey::KeyArray CopyKeyArray(const WebIDBKey& other) { } return result; } -} // namespace +} // namespace IndexedDBKey::IndexedDBKey() : type_(WebIDBKey::NullType), @@ -105,8 +104,6 @@ IndexedDBKey::IndexedDBKey(const string16& key) IndexedDBKey::~IndexedDBKey() {} int IndexedDBKey::Compare(const IndexedDBKey& other) const { - DCHECK(IsValid()); - DCHECK(other.IsValid()); if (type_ != other.type_) return type_ > other.type_ ? -1 : 1; @@ -124,17 +121,15 @@ int IndexedDBKey::Compare(const IndexedDBKey& other) const { case WebIDBKey::StringType: return -other.string_.compare(string_); case WebIDBKey::DateType: - return (date_ < other.date_) ? -1 : (date_ > other.date_) ? 1 : 0; case WebIDBKey::NumberType: return (number_ < other.number_) ? -1 : (number_ > other.number_) ? 1 : 0; case WebIDBKey::InvalidType: case WebIDBKey::NullType: - case WebIDBKey::MinType: + default: + // This is a placeholder for WebKit::WebIDBKey::MinType NOTREACHED(); return 0; } - NOTREACHED(); - return 0; } bool IndexedDBKey::IsLessThan(const IndexedDBKey& other) const { @@ -145,20 +140,6 @@ bool IndexedDBKey::IsEqual(const IndexedDBKey& other) const { return !Compare(other); } -bool IndexedDBKey::IsValid() const { - if (type_ == WebIDBKey::InvalidType || type_ == WebIDBKey::NullType) - return false; - - if (type_ == WebIDBKey::ArrayType) { - for (size_t i = 0; i < array_.size(); i++) { - if (!array_[i].IsValid()) - return false; - } - } - - return true; -} - IndexedDBKey::operator WebIDBKey() const { switch (type_) { case WebIDBKey::ArrayType: @@ -173,12 +154,11 @@ IndexedDBKey::operator WebIDBKey() const { return WebIDBKey::createInvalid(); case WebIDBKey::NullType: return WebIDBKey::createNull(); - case WebIDBKey::MinType: + default: + // This is a placeholder for WebKit::WebIDBKey::MinType NOTREACHED(); return WebIDBKey::createInvalid(); } - NOTREACHED(); - return WebIDBKey::createInvalid(); } } // namespace content diff --git a/content/common/indexed_db/indexed_db_param_traits.cc b/content/common/indexed_db/indexed_db_param_traits.cc index 58019ce..8593f75 100644 --- a/content/common/indexed_db/indexed_db_param_traits.cc +++ b/content/common/indexed_db/indexed_db_param_traits.cc @@ -4,8 +4,6 @@ #include "content/common/indexed_db/indexed_db_param_traits.h" -#include <string> -#include <vector> #include "content/common/indexed_db/indexed_db_key.h" #include "content/common/indexed_db/indexed_db_key_path.h" #include "content/common/indexed_db/indexed_db_key_range.h" @@ -21,7 +19,7 @@ using WebKit::WebIDBKeyPath; namespace IPC { void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p.type())); + WriteParam(m, int(p.type())); switch (p.type()) { case WebIDBKey::ArrayType: WriteParam(m, p.array()); @@ -38,7 +36,8 @@ void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) { case WebIDBKey::InvalidType: case WebIDBKey::NullType: return; - case WebIDBKey::MinType: + default: + // This is a placeholder for WebKit::WebIDBKey::MinType NOTREACHED(); return; } @@ -79,17 +78,16 @@ bool ParamTraits<IndexedDBKey>::Read(const Message* m, case WebIDBKey::NullType: *r = IndexedDBKey(web_type); return true; - case WebIDBKey::MinType: + default: + // This is a placeholder for WebKit::WebIDBKey::MinType NOTREACHED(); return false; } - NOTREACHED(); - return false; } void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) { l->append("<IndexedDBKey>("); - LogParam(static_cast<int>(p.type()), l); + LogParam(int(p.type()), l); l->append(", "); l->append("["); std::vector<IndexedDBKey>::const_iterator it = p.array().begin(); @@ -109,7 +107,7 @@ void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) { } void ParamTraits<IndexedDBKeyPath>::Write(Message* m, const param_type& p) { - WriteParam(m, static_cast<int>(p.type())); + WriteParam(m, int(p.type())); switch (p.type()) { case WebIDBKeyPath::ArrayType: WriteParam(m, p.array()); @@ -155,7 +153,7 @@ bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m, void ParamTraits<IndexedDBKeyPath>::Log(const param_type& p, std::string* l) { l->append("<IndexedDBKeyPath>("); - LogParam(static_cast<int>(p.type()), l); + LogParam(int(p.type()), l); l->append(", "); LogParam(p.string(), l); l->append(", "); |