Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / modules / indexeddb / WebIDBValue.h
blob401267de51e7d7f2c3ccb505013a74b6d36f6ec5
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
3 // found in the LICENSE file.
5 #ifndef WebIDBValue_h
6 #define WebIDBValue_h
8 #include "public/platform/WebBlobInfo.h"
9 #include "public/platform/WebData.h"
10 #include "public/platform/WebVector.h"
11 #include "public/platform/modules/indexeddb/WebIDBKey.h"
12 #include "public/platform/modules/indexeddb/WebIDBKeyPath.h"
14 namespace blink {
16 struct WebIDBValue {
17 WebIDBValue() { }
18 explicit WebIDBValue(const WebData& data) : data(data) { }
19 WebIDBValue(const WebData& data, const WebVector<WebBlobInfo>& blobInfo) : data(data), webBlobInfo(blobInfo) { }
20 WebIDBValue(const WebData& data, const WebVector<WebBlobInfo>& blobInfo, const WebIDBKey& primaryKey, const WebIDBKeyPath& keyPath) : data(data), webBlobInfo(blobInfo), primaryKey(primaryKey), keyPath(keyPath) { }
22 // The serialized JavaScript bits (ignoring blob data) for this IDB Value. Required value.
23 WebData data;
24 // Collection of blob info referenced by [[data]]. Optional and empty for values without blobs.
25 WebVector<WebBlobInfo> webBlobInfo;
26 // The auto-generated primary key and key path. Both are set when IDB is generating keys (and not JavaScript).
27 // Optional; If set then a property named [[keyPath]] will be set to [[primaryKey]] on the deserialized
28 // [[data]] object before calling the event handler.
29 WebIDBKey primaryKey;
30 WebIDBKeyPath keyPath;
33 } // namespace blink
35 #endif