| 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 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool isEqual(const IDBKey* other) const; | 108 bool isEqual(const IDBKey* other) const; |
| 109 | 109 |
| 110 // Returns a new key array with invalid keys and duplicates removed. | 110 // Returns a new key array with invalid keys and duplicates removed. |
| 111 KeyArray toMultiEntryArray() const; | 111 KeyArray toMultiEntryArray() const; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 IDBKey() : m_type(InvalidType) {} | 114 IDBKey() : m_type(InvalidType) {} |
| 115 IDBKey(Type type, double number) : m_type(type), m_number(number) {} | 115 IDBKey(Type type, double number) : m_type(type), m_number(number) {} |
| 116 explicit IDBKey(const String& value) : m_type(StringType), m_string(value) {} | 116 explicit IDBKey(const String& value) : m_type(StringType), m_string(value) {} |
| 117 explicit IDBKey(PassRefPtr<SharedBuffer> value) | 117 explicit IDBKey(PassRefPtr<SharedBuffer> value) |
| 118 : m_type(BinaryType), m_binary(value) {} | 118 : m_type(BinaryType), m_binary(std::move(value)) {} |
| 119 explicit IDBKey(const KeyArray& keyArray) | 119 explicit IDBKey(const KeyArray& keyArray) |
| 120 : m_type(ArrayType), m_array(keyArray) {} | 120 : m_type(ArrayType), m_array(keyArray) {} |
| 121 | 121 |
| 122 const Type m_type; | 122 const Type m_type; |
| 123 const KeyArray m_array; | 123 const KeyArray m_array; |
| 124 RefPtr<SharedBuffer> m_binary; | 124 RefPtr<SharedBuffer> m_binary; |
| 125 const String m_string; | 125 const String m_string; |
| 126 const double m_number = 0; | 126 const double m_number = 0; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace blink | 129 } // namespace blink |
| 130 | 130 |
| 131 #endif // IDBKey_h | 131 #endif // IDBKey_h |
| OLD | NEW |