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 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange& other) = default; | 27 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange& other) = default; |
28 IndexedDBKeyRange::~IndexedDBKeyRange() = default; | 28 IndexedDBKeyRange::~IndexedDBKeyRange() = default; |
29 IndexedDBKeyRange& IndexedDBKeyRange::operator=( | 29 IndexedDBKeyRange& IndexedDBKeyRange::operator=( |
30 const IndexedDBKeyRange& other) = default; | 30 const IndexedDBKeyRange& other) = default; |
31 | 31 |
32 bool IndexedDBKeyRange::IsOnlyKey() const { | 32 bool IndexedDBKeyRange::IsOnlyKey() const { |
33 if (lower_open_ || upper_open_) | 33 if (lower_open_ || upper_open_) |
34 return false; | 34 return false; |
| 35 if (IsEmpty()) |
| 36 return false; |
35 | 37 |
36 return lower_.Equals(upper_); | 38 return lower_.Equals(upper_); |
37 } | 39 } |
38 | 40 |
| 41 bool IndexedDBKeyRange::IsEmpty() const { |
| 42 return !lower_.IsValid() && !upper_.IsValid(); |
| 43 } |
| 44 |
39 } // namespace content | 45 } // namespace content |
OLD | NEW |