| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/indexed_db/indexed_db_key_range.h" | 5 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/WebKit/public/platform/WebIDBTypes.h" | 8 #include "third_party/WebKit/public/platform/WebIDBTypes.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : lower_(key), upper_(key), lower_open_(false), upper_open_(false) {} | 28 : lower_(key), upper_(key), lower_open_(false), upper_open_(false) {} |
| 29 | 29 |
| 30 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange& other) = default; | 30 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange& other) = default; |
| 31 IndexedDBKeyRange::~IndexedDBKeyRange() = default; | 31 IndexedDBKeyRange::~IndexedDBKeyRange() = default; |
| 32 IndexedDBKeyRange& IndexedDBKeyRange::operator=( | 32 IndexedDBKeyRange& IndexedDBKeyRange::operator=( |
| 33 const IndexedDBKeyRange& other) = default; | 33 const IndexedDBKeyRange& other) = default; |
| 34 | 34 |
| 35 bool IndexedDBKeyRange::IsOnlyKey() const { | 35 bool IndexedDBKeyRange::IsOnlyKey() const { |
| 36 if (lower_open_ || upper_open_) | 36 if (lower_open_ || upper_open_) |
| 37 return false; | 37 return false; |
| 38 if (IsEmpty()) |
| 39 return false; |
| 38 | 40 |
| 39 return lower_.Equals(upper_); | 41 return lower_.Equals(upper_); |
| 40 } | 42 } |
| 41 | 43 |
| 44 bool IndexedDBKeyRange::IsEmpty() const { |
| 45 return !lower_.IsValid() && !upper_.IsValid(); |
| 46 } |
| 47 |
| 42 } // namespace content | 48 } // namespace content |
| OLD | NEW |