| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ | 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ | 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "third_party/WebKit/public/platform/WebIDBKeyPath.h" | 13 #include "third_party/WebKit/public/platform/WebIDBTypes.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class CONTENT_EXPORT IndexedDBKeyPath { | 17 class CONTENT_EXPORT IndexedDBKeyPath { |
| 18 public: | 18 public: |
| 19 IndexedDBKeyPath(); // Defaults to WebKit::WebIDBKeyPathTypeNull. | 19 IndexedDBKeyPath(); // Defaults to WebKit::WebIDBKeyPathTypeNull. |
| 20 explicit IndexedDBKeyPath(const string16&); | 20 explicit IndexedDBKeyPath(const string16&); |
| 21 explicit IndexedDBKeyPath(const std::vector<string16>&); | 21 explicit IndexedDBKeyPath(const std::vector<string16>&); |
| 22 explicit IndexedDBKeyPath(const WebKit::WebIDBKeyPath&); | |
| 23 ~IndexedDBKeyPath(); | 22 ~IndexedDBKeyPath(); |
| 24 | 23 |
| 25 bool IsNull() const { return type_ == WebKit::WebIDBKeyPathTypeNull; } | 24 bool IsNull() const { return type_ == WebKit::WebIDBKeyPathTypeNull; } |
| 26 bool IsValid() const; | |
| 27 bool operator==(const IndexedDBKeyPath& other) const; | 25 bool operator==(const IndexedDBKeyPath& other) const; |
| 28 | 26 |
| 29 WebKit::WebIDBKeyPathType type() const { return type_; } | 27 WebKit::WebIDBKeyPathType type() const { return type_; } |
| 30 const std::vector<string16>& array() const; | 28 const std::vector<string16>& array() const; |
| 31 const string16& string() const; | 29 const string16& string() const; |
| 32 operator WebKit::WebIDBKeyPath() const; | |
| 33 | 30 |
| 34 private: | 31 private: |
| 35 WebKit::WebIDBKeyPathType type_; | 32 WebKit::WebIDBKeyPathType type_; |
| 36 string16 string_; | 33 string16 string_; |
| 37 std::vector<string16> array_; | 34 std::vector<string16> array_; |
| 38 }; | 35 }; |
| 39 | 36 |
| 40 } // namespace content | 37 } // namespace content |
| 41 | 38 |
| 42 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ | 39 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| OLD | NEW |