| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 public: | 41 public: |
| 42 // Please use one of the factory methods. This is public only to allow WebVe
ctor. | 42 // Please use one of the factory methods. This is public only to allow WebVe
ctor. |
| 43 WebIDBKey() { } | 43 WebIDBKey() { } |
| 44 ~WebIDBKey() { reset(); } | 44 ~WebIDBKey() { reset(); } |
| 45 | 45 |
| 46 WEBKIT_API static WebIDBKey createNull(); | 46 WEBKIT_API static WebIDBKey createNull(); |
| 47 WEBKIT_API static WebIDBKey createInvalid(); | 47 WEBKIT_API static WebIDBKey createInvalid(); |
| 48 WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScr
iptValue&, const WebIDBKeyPath&); | 48 WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScr
iptValue&, const WebIDBKeyPath&); |
| 49 | 49 |
| 50 WebIDBKey(const WebString& string) { assign(string); } | 50 WebIDBKey(const WebString& string) { assign(string); } |
| 51 WebIDBKey(int32_t number) { assign(number); } | 51 WebIDBKey(double number) { assign(number); } |
| 52 WebIDBKey(const WebIDBKey& e) { assign(e); } | 52 WebIDBKey(const WebIDBKey& e) { assign(e); } |
| 53 WebIDBKey& operator=(const WebIDBKey& e) | 53 WebIDBKey& operator=(const WebIDBKey& e) |
| 54 { | 54 { |
| 55 assign(e); | 55 assign(e); |
| 56 return *this; | 56 return *this; |
| 57 } | 57 } |
| 58 | 58 |
| 59 WEBKIT_API void assign(const WebIDBKey&); | 59 WEBKIT_API void assign(const WebIDBKey&); |
| 60 WEBKIT_API void assignNull(); | 60 WEBKIT_API void assignNull(); |
| 61 WEBKIT_API void assign(const WebString&); | 61 WEBKIT_API void assign(const WebString&); |
| 62 WEBKIT_API void assign(int32_t); | 62 WEBKIT_API void assign(double); |
| 63 WEBKIT_API void assignInvalid(); | 63 WEBKIT_API void assignInvalid(); |
| 64 WEBKIT_API void reset(); | 64 WEBKIT_API void reset(); |
| 65 | 65 |
| 66 enum Type { | 66 enum Type { |
| 67 NullType = 0, | 67 NullType = 0, |
| 68 StringType, | 68 StringType, |
| 69 NumberType, | 69 NumberType, |
| 70 // Types not in WebCore::IDBKey: | 70 // Types not in WebCore::IDBKey: |
| 71 InvalidType | 71 InvalidType |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 WEBKIT_API Type type() const; | 74 WEBKIT_API Type type() const; |
| 75 WEBKIT_API WebString string() const; // Only valid for StringType. | 75 WEBKIT_API WebString string() const; // Only valid for StringType. |
| 76 WEBKIT_API int32_t number() const; // Only valid for numberType. | 76 WEBKIT_API double number() const; // Only valid for numberType. |
| 77 | 77 |
| 78 #if WEBKIT_IMPLEMENTATION | 78 #if WEBKIT_IMPLEMENTATION |
| 79 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); | 79 WebIDBKey(const WTF::PassRefPtr<WebCore::IDBKey>&); |
| 80 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); | 80 WebIDBKey& operator=(const WTF::PassRefPtr<WebCore::IDBKey>&); |
| 81 operator WTF::PassRefPtr<WebCore::IDBKey>() const; | 81 operator WTF::PassRefPtr<WebCore::IDBKey>() const; |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 WebPrivatePtr<WebCore::IDBKey> m_private; | 85 WebPrivatePtr<WebCore::IDBKey> m_private; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace WebKit | 88 } // namespace WebKit |
| 89 | 89 |
| 90 #endif // WebIDBKey_h | 90 #endif // WebIDBKey_h |
| OLD | NEW |