Add remoting and PPAPI tests to GN build
[chromium-blink-merge.git] / content / common / indexed_db / indexed_db_key_range.cc
blobd061363fbde4c1baac4147da00eb091b0a9b96fb
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/WebIDBTypes.h"
10 namespace content {
12 IndexedDBKeyRange::IndexedDBKeyRange()
13 : lower_(blink::WebIDBKeyTypeNull),
14 upper_(blink::WebIDBKeyTypeNull),
15 lower_open_(false),
16 upper_open_(false) {}
18 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKey& lower,
19 const IndexedDBKey& upper,
20 bool lower_open,
21 bool upper_open)
22 : lower_(lower),
23 upper_(upper),
24 lower_open_(lower_open),
25 upper_open_(upper_open) {}
27 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKey& key)
28 : lower_(key), upper_(key), lower_open_(false), upper_open_(false) {}
30 IndexedDBKeyRange::IndexedDBKeyRange(const IndexedDBKeyRange& other) = default;
31 IndexedDBKeyRange::~IndexedDBKeyRange() = default;
32 IndexedDBKeyRange& IndexedDBKeyRange::operator=(
33 const IndexedDBKeyRange& other) = default;
35 bool IndexedDBKeyRange::IsOnlyKey() const {
36 if (lower_open_ || upper_open_)
37 return false;
39 return lower_.Equals(upper_);
42 } // namespace content