| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebIDBValue_h | 5 #ifndef WebIDBValue_h |
| 6 #define WebIDBValue_h | 6 #define WebIDBValue_h |
| 7 | 7 |
| 8 #include "public/platform/WebBlobInfo.h" | 8 #include "public/platform/WebBlobInfo.h" |
| 9 #include "public/platform/WebData.h" | 9 #include "public/platform/WebData.h" |
| 10 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
| 11 #include "public/platform/modules/indexeddb/WebIDBKey.h" | 11 #include "public/platform/modules/indexeddb/WebIDBKey.h" |
| 12 #include "public/platform/modules/indexeddb/WebIDBKeyPath.h" | 12 #include "public/platform/modules/indexeddb/WebIDBKeyPath.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 struct WebIDBValue { | 16 struct WebIDBValue { |
| 17 WebIDBValue() {} | 17 WebIDBValue() {} |
| 18 explicit WebIDBValue(const WebData& data) : data(data) {} | 18 explicit WebIDBValue(const WebData& data) : data(data) {} |
| 19 WebIDBValue(const WebData& data, const WebVector<WebBlobInfo>& blobInfo) | 19 WebIDBValue(const WebData& data, const WebVector<WebBlobInfo>& blobInfo) |
| 20 : data(data), webBlobInfo(blobInfo) {} | 20 : data(data), webBlobInfo(blobInfo) {} |
| 21 WebIDBValue(const WebData& data, | 21 WebIDBValue(const WebData& data, |
| 22 const WebVector<WebBlobInfo>& blobInfo, | 22 const WebVector<WebBlobInfo>& blobInfo, |
| 23 const WebIDBKey& primaryKey, | 23 const WebIDBKey& primaryKey, |
| 24 const WebIDBKeyPath& keyPath) | 24 const WebIDBKeyPath& keyPath) |
| 25 : data(data), | 25 : data(data), |
| 26 webBlobInfo(blobInfo), | 26 webBlobInfo(blobInfo), |
| 27 primaryKey(primaryKey), | 27 primaryKey(primaryKey), |
| 28 keyPath(keyPath) {} | 28 keyPath(keyPath) {} |
| 29 | 29 |
| 30 // The serialized JavaScript bits (ignoring blob data) for this IDB Value. Req
uired value. | 30 // The serialized JavaScript bits (ignoring blob data) for this IDB Value. |
| 31 // Required value. |
| 31 WebData data; | 32 WebData data; |
| 32 // Collection of blob info referenced by [[data]]. Optional and empty for valu
es without blobs. | 33 // Collection of blob info referenced by [[data]]. Optional and empty for |
| 34 // values without blobs. |
| 33 WebVector<WebBlobInfo> webBlobInfo; | 35 WebVector<WebBlobInfo> webBlobInfo; |
| 34 // The auto-generated primary key and key path. Both are set when IDB is gener
ating keys (and not JavaScript). | 36 // The auto-generated primary key and key path. Both are set when IDB is |
| 35 // Optional; If set then a property named [[keyPath]] will be set to [[primary
Key]] on the deserialized | 37 // generating keys (and not JavaScript). Optional; If set then a property |
| 38 // named [[keyPath]] will be set to [[primaryKey]] on the deserialized |
| 36 // [[data]] object before calling the event handler. | 39 // [[data]] object before calling the event handler. |
| 37 WebIDBKey primaryKey; | 40 WebIDBKey primaryKey; |
| 38 WebIDBKeyPath keyPath; | 41 WebIDBKeyPath keyPath; |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 } // namespace blink | 44 } // namespace blink |
| 42 | 45 |
| 43 #endif | 46 #endif |
| OLD | NEW |