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 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_
11 #include "base/logging.h"
12 #include "base/strings/string16.h"
13 #include "content/common/content_export.h"
14 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
18 class CONTENT_EXPORT IndexedDBKeyPath
{
20 IndexedDBKeyPath(); // Defaults to blink::WebIDBKeyPathTypeNull.
21 explicit IndexedDBKeyPath(const base::string16
&);
22 explicit IndexedDBKeyPath(const std::vector
<base::string16
>&);
23 IndexedDBKeyPath(const IndexedDBKeyPath
& other
);
25 IndexedDBKeyPath
& operator=(const IndexedDBKeyPath
& other
);
27 bool IsNull() const { return type_
== blink::WebIDBKeyPathTypeNull
; }
28 bool operator==(const IndexedDBKeyPath
& other
) const;
30 blink::WebIDBKeyPathType
type() const { return type_
; }
31 const std::vector
<base::string16
>& array() const;
32 const base::string16
& string() const;
35 blink::WebIDBKeyPathType type_
;
36 base::string16 string_
;
37 std::vector
<base::string16
> array_
;
40 } // namespace content
42 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_