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_H_
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
10 #include "base/basictypes.h"
11 #include "base/string16.h"
12 #include "content/common/content_export.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
17 class CONTENT_EXPORT IndexedDBKey
{
19 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType.
20 explicit IndexedDBKey(const WebKit::WebIDBKey
& key
);
25 void SetArray(const std::vector
<IndexedDBKey
>& array
);
26 void SetString(const string16
& string
);
27 void SetDate(double date
);
28 void SetNumber(double number
);
29 void Set(const WebKit::WebIDBKey
& key
);
31 WebKit::WebIDBKey::Type
type() const { return type_
; }
32 const std::vector
<IndexedDBKey
>& array() const { return array_
; }
33 const string16
& string() const { return string_
; }
34 double date() const { return date_
; }
35 double number() const { return number_
; }
37 operator WebKit::WebIDBKey() const;
40 WebKit::WebIDBKey::Type type_
;
41 std::vector
<IndexedDBKey
> array_
;
47 } // namespace content
49 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_