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

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

Issue 8276023: IndexedDB: Wrong exception types thrown for invalid keys (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated copyright years Created 9 years, 1 month 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
« no previous file with comments | « no previous file | content/common/indexed_db_key.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_KEY_H_ 5 #ifndef CONTENT_COMMON_INDEXED_DB_KEY_H_
6 #define CONTENT_COMMON_INDEXED_DB_KEY_H_ 6 #define CONTENT_COMMON_INDEXED_DB_KEY_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
13 13
14 class CONTENT_EXPORT IndexedDBKey { 14 class CONTENT_EXPORT IndexedDBKey {
15 public: 15 public:
16 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType. 16 IndexedDBKey(); // Defaults to WebKit::WebIDBKey::InvalidType.
17 explicit IndexedDBKey(const WebKit::WebIDBKey& key); 17 explicit IndexedDBKey(const WebKit::WebIDBKey& key);
18 ~IndexedDBKey(); 18 ~IndexedDBKey();
19 19
20 void SetNull();
21 void SetInvalid(); 20 void SetInvalid();
22 void SetString(const string16& string); 21 void SetString(const string16& string);
23 void SetDate(double date); 22 void SetDate(double date);
24 void SetNumber(double number); 23 void SetNumber(double number);
25 void Set(const WebKit::WebIDBKey& key); 24 void Set(const WebKit::WebIDBKey& key);
26 25
27 WebKit::WebIDBKey::Type type() const { return type_; } 26 WebKit::WebIDBKey::Type type() const { return type_; }
28 const string16& string() const { return string_; } 27 const string16& string() const { return string_; }
29 double date() const { return date_; } 28 double date() const { return date_; }
30 double number() const { return number_; } 29 double number() const { return number_; }
31 30
32 operator WebKit::WebIDBKey() const; 31 operator WebKit::WebIDBKey() const;
33 32
34 private: 33 private:
35 WebKit::WebIDBKey::Type type_; 34 WebKit::WebIDBKey::Type type_;
36 string16 string_; 35 string16 string_;
37 double date_; 36 double date_;
38 double number_; 37 double number_;
39 }; 38 };
40 39
41 #endif // CONTENT_COMMON_INDEXED_DB_KEY_H_ 40 #endif // CONTENT_COMMON_INDEXED_DB_KEY_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/indexed_db_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698