Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1446)

Unified Diff: content/common/indexed_db/indexed_db_key_path.h

Issue 10204003: Use WebIDBKeyPath type in WebKit API, implement IndexedDBKeyPath type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IndexedDBKeyPath to content namespace, formatting nits. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5c09d56adc5a815eeafd10c751ba781925c4b6f3
--- /dev/null
+++ b/content/common/indexed_db/indexed_db_key_path.h
@@ -0,0 +1,45 @@
+// 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"
+
+namespace content {
+
+class CONTENT_EXPORT IndexedDBKeyPath {
+ 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_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_PATH_H_
« no previous file with comments | « content/browser/indexed_db/idbbindingutilities_browsertest.cc ('k') | content/common/indexed_db/indexed_db_key_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698