| Index: trunk/src/content/common/indexed_db/indexed_db_key.cc
|
| ===================================================================
|
| --- trunk/src/content/common/indexed_db/indexed_db_key.cc (revision 202301)
|
| +++ trunk/src/content/common/indexed_db/indexed_db_key.cc (working copy)
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "content/common/indexed_db/indexed_db_key.h"
|
|
|
| -#include <string>
|
| #include "base/logging.h"
|
| #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
|
| #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h"
|
| @@ -61,7 +60,7 @@
|
| }
|
| return result;
|
| }
|
| -} // namespace
|
| +} // namespace
|
|
|
| IndexedDBKey::IndexedDBKey()
|
| : type_(WebIDBKey::NullType),
|
| @@ -105,8 +104,6 @@
|
| 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 @@
|
| 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 @@
|
| 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 @@
|
| 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
|
|
|