OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_INDEXED_DB_KEY_H_ | 5 #ifndef CHROME_COMMON_INDEXED_DB_KEY_H_ |
6 #define CHROME_COMMON_INDEXED_DB_KEY_H_ | 6 #define CHROME_COMMON_INDEXED_DB_KEY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h" |
12 | 12 |
13 class IndexedDBKey { | 13 class IndexedDBKey { |
14 public: | 14 public: |
15 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType. | 15 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType. |
16 explicit IndexedDBKey(const WebKit::WebIDBKey& key); | 16 explicit IndexedDBKey(const WebKit::WebIDBKey& key); |
17 ~IndexedDBKey(); | 17 ~IndexedDBKey(); |
18 | 18 |
19 void SetNull(); | 19 void SetNull(); |
20 void SetInvalid(); | 20 void SetInvalid(); |
21 void Set(const string16& string); | 21 void Set(const string16& string); |
22 void Set(int32_t number); | 22 void Set(double number); |
23 void Set(const WebKit::WebIDBKey& key); | 23 void Set(const WebKit::WebIDBKey& key); |
24 | 24 |
25 WebKit::WebIDBKey::Type type() const { return type_; } | 25 WebKit::WebIDBKey::Type type() const { return type_; } |
26 const string16& string() const { return string_; } | 26 const string16& string() const { return string_; } |
27 int32_t number() const { return number_; } | 27 double number() const { return number_; } |
28 | 28 |
29 operator WebKit::WebIDBKey() const; | 29 operator WebKit::WebIDBKey() const; |
30 | 30 |
31 private: | 31 private: |
32 WebKit::WebIDBKey::Type type_; | 32 WebKit::WebIDBKey::Type type_; |
33 string16 string_; | 33 string16 string_; |
34 int32_t number_; | 34 double number_; |
35 }; | 35 }; |
36 | 36 |
37 #endif // CHROME_COMMON_INDEXED_DB_KEY_H_ | 37 #endif // CHROME_COMMON_INDEXED_DB_KEY_H_ |
OLD | NEW |