[Android WebView] Fix webview perf bot switchover to use org.chromium.webview_shell...
[chromium-blink-merge.git] / content / common / indexed_db / indexed_db_key_range.cc
blobf1938bfb2cd71f5ccdcaf77c08d98cfcab74fdb4
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"
10 namespace content {
12 IndexedDBKeyRange::IndexedDBKeyRange() = default;
14 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKey& lower,
15 const IndexedDBKey& upper,
16 bool lower_open,
17 bool upper_open)
18 : lower_(lower),
19 upper_(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_)
34 return false;
35 if (IsEmpty())
36 return false;
38 return lower_.Equals(upper_);
41 bool IndexedDBKeyRange::IsEmpty() const {
42 return !lower_.IsValid() && !upper_.IsValid();
45 } // namespace content