Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * | 13 * |
| 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WebIDBKey_h | 26 #ifndef WebIDBKey_h |
| 27 #define WebIDBKey_h | 27 #define WebIDBKey_h |
| 28 | 28 |
| 29 #include "WebCommon.h" | 29 #include "WebCommon.h" |
| 30 #include "WebIDBKeyType.h" | |
| 30 #include "WebPrivatePtr.h" | 31 #include "WebPrivatePtr.h" |
| 31 #include "WebString.h" | 32 #include "WebString.h" |
| 32 #include "WebVector.h" | 33 #include "WebVector.h" |
| 33 | 34 |
| 34 namespace WebCore { class IDBKey; } | 35 namespace WebCore { class IDBKey; } |
| 35 | 36 |
| 36 namespace WebKit { | 37 namespace WebKit { |
| 37 | 38 |
| 38 class WebIDBKey { | 39 class WebIDBKey { |
| 39 public: | 40 public: |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 57 | 58 |
| 58 WEBKIT_EXPORT void assign(const WebIDBKey&); | 59 WEBKIT_EXPORT void assign(const WebIDBKey&); |
| 59 WEBKIT_EXPORT void assignArray(const WebVector<WebIDBKey>&); | 60 WEBKIT_EXPORT void assignArray(const WebVector<WebIDBKey>&); |
| 60 WEBKIT_EXPORT void assignString(const WebString&); | 61 WEBKIT_EXPORT void assignString(const WebString&); |
| 61 WEBKIT_EXPORT void assignDate(double); | 62 WEBKIT_EXPORT void assignDate(double); |
| 62 WEBKIT_EXPORT void assignNumber(double); | 63 WEBKIT_EXPORT void assignNumber(double); |
| 63 WEBKIT_EXPORT void assignInvalid(); | 64 WEBKIT_EXPORT void assignInvalid(); |
| 64 WEBKIT_EXPORT void assignNull(); | 65 WEBKIT_EXPORT void assignNull(); |
| 65 WEBKIT_EXPORT void reset(); | 66 WEBKIT_EXPORT void reset(); |
| 66 | 67 |
| 68 WEBKIT_EXPORT WebIDBKeyType keyType() const; | |
|
jamesr
2013/07/16 00:57:20
this is an unfortunately stuttery name, but since
| |
| 69 WEBKIT_EXPORT bool isValid() const; | |
| 70 WEBKIT_EXPORT WebVector<WebIDBKey> array() const; // Only valid for ArrayTyp e. | |
| 71 WEBKIT_EXPORT WebString string() const; // Only valid for StringType. | |
| 72 WEBKIT_EXPORT double date() const; // Only valid for DateType. | |
| 73 WEBKIT_EXPORT double number() const; // Only valid for NumberType. | |
| 74 | |
| 75 // DEPRECATED. FIXME: Remove once all callers switch over to WebIDBKeyType / keyType(). | |
| 67 enum Type { | 76 enum Type { |
| 68 InvalidType = 0, | 77 InvalidType = 0, |
| 69 ArrayType, | 78 ArrayType, |
| 70 StringType, | 79 StringType, |
| 71 DateType, | 80 DateType, |
| 72 NumberType, | 81 NumberType, |
| 73 NullType, | 82 NullType, |
| 74 MinType, | 83 MinType, |
| 75 }; | 84 }; |
| 76 | |
| 77 WEBKIT_EXPORT Type type() const; | 85 WEBKIT_EXPORT Type type() const; |
| 78 WEBKIT_EXPORT bool isValid() const; | |
| 79 WEBKIT_EXPORT WebVector<WebIDBKey> array() const; // Only valid for ArrayTyp e. | |
| 80 WEBKIT_EXPORT WebString string() const; // Only valid for StringType. | |
| 81 WEBKIT_EXPORT double date() const; // Only valid for DateType. | |
| 82 WEBKIT_EXPORT double number() const; // Only valid for NumberType. | |
| 83 | 86 |
| 84 #if WEBKIT_IMPLEMENTATION | 87 #if WEBKIT_IMPLEMENTATION |
| 85 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); | 88 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); |
| 86 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); | 89 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); |
| 87 operator WTF::PassRefPtr<WebCore::IDBKey>() const; | 90 operator WTF::PassRefPtr<WebCore::IDBKey>() const; |
| 88 #endif | 91 #endif |
| 89 | 92 |
| 90 private: | 93 private: |
| 91 WebPrivatePtr<WebCore::IDBKey> m_private; | 94 WebPrivatePtr<WebCore::IDBKey> m_private; |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 } // namespace WebKit | 97 } // namespace WebKit |
| 95 | 98 |
| 96 #endif // WebIDBKey_h | 99 #endif // WebIDBKey_h |
| OLD | NEW |