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 IDBValue_h | 5 #ifndef IDBValue_h |
6 #define IDBValue_h | 6 #define IDBValue_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "modules/indexeddb/IDBKey.h" | 9 #include "modules/indexeddb/IDBKey.h" |
10 #include "modules/indexeddb/IDBKeyPath.h" | 10 #include "modules/indexeddb/IDBKeyPath.h" |
11 #include "platform/SharedBuffer.h" | 11 #include "platform/SharedBuffer.h" |
12 #include "public/platform/WebVector.h" | 12 #include "public/platform/WebVector.h" |
| 13 #include "wtf/OwnPtr.h" |
13 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
14 #include <memory> | |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class BlobDataHandle; | 18 class BlobDataHandle; |
19 class WebBlobInfo; | 19 class WebBlobInfo; |
20 struct WebIDBValue; | 20 struct WebIDBValue; |
21 | 21 |
22 class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> { | 22 class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> { |
23 public: | 23 public: |
24 static PassRefPtr<IDBValue> create(); | 24 static PassRefPtr<IDBValue> create(); |
25 static PassRefPtr<IDBValue> create(const WebIDBValue&); | 25 static PassRefPtr<IDBValue> create(const WebIDBValue&); |
26 static PassRefPtr<IDBValue> create(const IDBValue*, IDBKey*, const IDBKeyPat
h&); | 26 static PassRefPtr<IDBValue> create(const IDBValue*, IDBKey*, const IDBKeyPat
h&); |
27 | 27 |
28 bool isNull() const; | 28 bool isNull() const; |
29 Vector<String> getUUIDs() const; | 29 Vector<String> getUUIDs() const; |
30 const SharedBuffer* data() const; | 30 const SharedBuffer* data() const; |
31 Vector<WebBlobInfo>* blobInfo() const { return m_blobInfo.get(); } | 31 Vector<WebBlobInfo>* blobInfo() const { return m_blobInfo.get(); } |
32 const IDBKey* primaryKey() const { return m_primaryKey; } | 32 const IDBKey* primaryKey() const { return m_primaryKey; } |
33 const IDBKeyPath& keyPath() const { return m_keyPath; } | 33 const IDBKeyPath& keyPath() const { return m_keyPath; } |
34 | 34 |
35 private: | 35 private: |
36 IDBValue(); | 36 IDBValue(); |
37 IDBValue(const WebIDBValue&); | 37 IDBValue(const WebIDBValue&); |
38 IDBValue(PassRefPtr<SharedBuffer>, const WebVector<WebBlobInfo>&, IDBKey*, c
onst IDBKeyPath&); | 38 IDBValue(PassRefPtr<SharedBuffer>, const WebVector<WebBlobInfo>&, IDBKey*, c
onst IDBKeyPath&); |
39 IDBValue(const IDBValue*, IDBKey*, const IDBKeyPath&); | 39 IDBValue(const IDBValue*, IDBKey*, const IDBKeyPath&); |
40 | 40 |
41 const RefPtr<SharedBuffer> m_data; | 41 const RefPtr<SharedBuffer> m_data; |
42 const std::unique_ptr<Vector<RefPtr<BlobDataHandle>>> m_blobData; | 42 const OwnPtr<Vector<RefPtr<BlobDataHandle>>> m_blobData; |
43 const std::unique_ptr<Vector<WebBlobInfo>> m_blobInfo; | 43 const OwnPtr<Vector<WebBlobInfo>> m_blobInfo; |
44 const Persistent<IDBKey> m_primaryKey; | 44 const Persistent<IDBKey> m_primaryKey; |
45 const IDBKeyPath m_keyPath; | 45 const IDBKeyPath m_keyPath; |
46 }; | 46 }; |
47 | 47 |
48 } // namespace blink | 48 } // namespace blink |
49 | 49 |
50 #endif | 50 #endif |
OLD | NEW |