Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USBInTransferResult.h

Issue 1639503002: Change USBTransferInResult.data to a DataView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webusb/USBInTransferResult.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 USBInTransferResult_h 5 #ifndef USBInTransferResult_h
6 #define USBInTransferResult_h 6 #define USBInTransferResult_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMArrayBuffer.h" 9 #include "core/dom/DOMArrayBuffer.h"
10 #include "core/dom/DOMDataView.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 #include "public/platform/modules/webusb/WebUSBTransferInfo.h" 12 #include "public/platform/modules/webusb/WebUSBTransferInfo.h"
12 #include "wtf/text/WTFString.h" 13 #include "wtf/text/WTFString.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class USBInTransferResult final 17 class USBInTransferResult final
17 : public GarbageCollectedFinalized<USBInTransferResult> 18 : public GarbageCollectedFinalized<USBInTransferResult>
18 , public ScriptWrappable { 19 , public ScriptWrappable {
19 DEFINE_WRAPPERTYPEINFO(); 20 DEFINE_WRAPPERTYPEINFO();
20 public: 21 public:
21 static USBInTransferResult* create(const String& status, const WebVector<uin t8_t> data) 22 static USBInTransferResult* create(const String& status, const WebVector<uin t8_t> data)
22 { 23 {
23 return new USBInTransferResult(status, data); 24 return new USBInTransferResult(status, data);
24 } 25 }
25 26
26 USBInTransferResult(const String& status, const WebVector<uint8_t> data) 27 USBInTransferResult(const String& status, const WebVector<uint8_t> data)
27 : m_status(status) 28 : m_status(status)
28 , m_data(DOMArrayBuffer::create(data.data(), data.size())) 29 , m_data(DOMDataView::create(DOMArrayBuffer::create(data.data(), data.si ze()), 0, data.size()))
29 { 30 {
30 } 31 }
31 32
32 virtual ~USBInTransferResult() { } 33 virtual ~USBInTransferResult() { }
33 34
34 String status() const { return m_status; } 35 String status() const { return m_status; }
35 PassRefPtr<DOMArrayBuffer> data() const { return m_data; } 36 PassRefPtr<DOMDataView> data() const { return m_data; }
36 37
37 DEFINE_INLINE_TRACE() { } 38 DEFINE_INLINE_TRACE() { }
38 39
39 private: 40 private:
40 const String m_status; 41 const String m_status;
41 const RefPtr<DOMArrayBuffer> m_data; 42 const RefPtr<DOMDataView> m_data;
42 }; 43 };
43 44
44 } // namespace blink 45 } // namespace blink
45 46
46 #endif // USBInTransferResult_h 47 #endif // USBInTransferResult_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webusb/USBInTransferResult.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698