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

Side by Side Diff: content/common/indexed_db/indexed_db_key.h

Issue 9212038: Distinguish null IDBKey (no value) and invalid IDBKey (value is not valid key) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-enable IndexedDBUILayoutTest.LayoutTests Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_ 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
15 15
16 class CONTENT_EXPORT IndexedDBKey { 16 class CONTENT_EXPORT IndexedDBKey {
17 public: 17 public:
18 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType. 18 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType.
19 explicit IndexedDBKey(const WebKit::WebIDBKey& key); 19 explicit IndexedDBKey(const WebKit::WebIDBKey& key);
20 ~IndexedDBKey(); 20 ~IndexedDBKey();
21 21
22 void SetNull();
22 void SetInvalid(); 23 void SetInvalid();
23 void SetArray(const std::vector<IndexedDBKey>& array); 24 void SetArray(const std::vector<IndexedDBKey>& array);
24 void SetString(const string16& string); 25 void SetString(const string16& string);
25 void SetDate(double date); 26 void SetDate(double date);
26 void SetNumber(double number); 27 void SetNumber(double number);
27 void Set(const WebKit::WebIDBKey& key); 28 void Set(const WebKit::WebIDBKey& key);
28 29
29 WebKit::WebIDBKey::Type type() const { return type_; } 30 WebKit::WebIDBKey::Type type() const { return type_; }
30 const std::vector<IndexedDBKey>& array() const { return array_; } 31 const std::vector<IndexedDBKey>& array() const { return array_; }
31 const string16& string() const { return string_; } 32 const string16& string() const { return string_; }
32 double date() const { return date_; } 33 double date() const { return date_; }
33 double number() const { return number_; } 34 double number() const { return number_; }
34 35
35 operator WebKit::WebIDBKey() const; 36 operator WebKit::WebIDBKey() const;
36 37
37 private: 38 private:
38 WebKit::WebIDBKey::Type type_; 39 WebKit::WebIDBKey::Type type_;
39 std::vector<IndexedDBKey> array_; 40 std::vector<IndexedDBKey> array_;
40 string16 string_; 41 string16 string_;
41 double date_; 42 double date_;
42 double number_; 43 double number_;
43 }; 44 };
44 45
45 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_ 46 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_
OLDNEW
« no previous file with comments | « content/browser/indexed_db/idbbindingutilities_browsertest.cc ('k') | content/common/indexed_db/indexed_db_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698