OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/string16.h" |
| 13 #include "content/common/content_export.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class CONTENT_EXPORT IndexedDBKeyPath { |
| 19 public: |
| 20 IndexedDBKeyPath(); // Defaults to WebKit::WebIDBKeyPath::NullType. |
| 21 explicit IndexedDBKeyPath(const WebKit::WebIDBKeyPath& keyPath); |
| 22 ~IndexedDBKeyPath(); |
| 23 |
| 24 void SetNull(); |
| 25 void SetArray(const std::vector<string16>& array); |
| 26 void SetString(const string16& string); |
| 27 void Set(const WebKit::WebIDBKeyPath& key); |
| 28 |
| 29 bool IsValid() const; |
| 30 |
| 31 WebKit::WebIDBKeyPath::Type type() const { return type_; } |
| 32 const std::vector<string16>& array() const { return array_; } |
| 33 const string16& string() const { return string_; } |
| 34 |
| 35 operator WebKit::WebIDBKeyPath() const; |
| 36 |
| 37 private: |
| 38 WebKit::WebIDBKeyPath::Type type_; |
| 39 std::vector<string16> array_; |
| 40 string16 string_; |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
OLD | NEW |