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
3 // found in the LICENSE file.
5 #include "content/common/indexed_db/indexed_db_key_range.h"
7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
12 IndexedDBKeyRange::IndexedDBKeyRange() = default;
14 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKey
& lower
,
15 const IndexedDBKey
& upper
,
20 lower_open_(lower_open
),
21 upper_open_(upper_open
) {}
23 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKey
& key
)
24 : lower_(key
), upper_(key
) {
27 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange
& other
) = default;
28 IndexedDBKeyRange::~IndexedDBKeyRange() = default;
29 IndexedDBKeyRange
& IndexedDBKeyRange::operator=(
30 const IndexedDBKeyRange
& other
) = default;
32 bool IndexedDBKeyRange::IsOnlyKey() const {
33 if (lower_open_
|| upper_open_
)
38 return lower_
.Equals(upper_
);
41 bool IndexedDBKeyRange::IsEmpty() const {
42 return !lower_
.IsValid() && !upper_
.IsValid();
45 } // namespace content