[content shell] hook up testRunner.dumpEditingCallbacks
[chromium-blink-merge.git] / content / common / indexed_db / indexed_db_key.h
blob0e11bf99d90a2b9c4e97235060538d6dbde81467
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_
8 #include <vector>
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"
15 namespace content {
17 class CONTENT_EXPORT IndexedDBKey {
18 public:
19 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType.
20 explicit IndexedDBKey(const WebKit::WebIDBKey& key);
21 ~IndexedDBKey();
23 void SetNull();
24 void SetInvalid();
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;
39 private:
40 WebKit::WebIDBKey::Type type_;
41 std::vector<IndexedDBKey> array_;
42 string16 string_;
43 double date_;
44 double number_;
47 } // namespace content
49 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_