Chromium Code Reviews| Index: content/common/indexed_db/indexed_db_key_path.h |
| diff --git a/content/common/indexed_db/indexed_db_key_path.h b/content/common/indexed_db/indexed_db_key_path.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..57eb7da8ec26097b500dc2092979fcaa22bac581 |
| --- /dev/null |
| +++ b/content/common/indexed_db/indexed_db_key_path.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| +#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |
| +#pragma once |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/string16.h" |
| +#include "content/common/content_export.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
| + |
| +class CONTENT_EXPORT IndexedDBKeyPath { |
|
jam
2012/04/30 16:01:29
nit: please put this in the "content" namespace, t
jsbell
2012/04/30 18:08:23
Done.
|
| + public: |
| + IndexedDBKeyPath(); // Defaults to WebKit::WebIDBKeyPath::NullType. |
| + explicit IndexedDBKeyPath(const WebKit::WebIDBKeyPath& keyPath); |
| + ~IndexedDBKeyPath(); |
| + |
| + void SetNull(); |
| + void SetArray(const std::vector<string16>& array); |
| + void SetString(const string16& string); |
| + void Set(const WebKit::WebIDBKeyPath& key); |
| + |
| + bool IsValid() const; |
| + |
| + WebKit::WebIDBKeyPath::Type type() const { return type_; } |
| + const std::vector<string16>& array() const { return array_; } |
| + const string16& string() const { return string_; } |
| + |
| + operator WebKit::WebIDBKeyPath() const; |
| + |
| + private: |
| + WebKit::WebIDBKeyPath::Type type_; |
| + std::vector<string16> array_; |
| + string16 string_; |
| +}; |
| + |
| +#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_ |