1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GPU_CompilationMessage_H_
7 #define GPU_CompilationMessage_H_
9 #include "nsWrapperCache.h"
10 #include "ObjectModel.h"
11 #include "mozilla/dom/WebGPUBinding.h"
18 class CompilationInfo
;
20 class CompilationMessage final
: public nsWrapperCache
, public ChildOf
<Device
> {
21 dom::GPUCompilationMessageType mType
;
22 uint64_t mLineNum
= 0;
23 uint64_t mLinePos
= 0;
29 GPU_DECL_CYCLE_COLLECTION(CompilationMessage
)
30 GPU_DECL_JS_WRAP(CompilationMessage
)
32 explicit CompilationMessage(Device
* const aParent
,
33 dom::GPUCompilationMessageType aType
,
34 uint64_t aLineNum
, uint64_t aLinePos
,
35 uint64_t aOffset
, uint64_t aLength
,
38 void GetMessage(dom::DOMString
& aMessage
) {
39 aMessage
.AsAString().Assign(mMessage
);
41 dom::GPUCompilationMessageType
Type() const { return mType
; }
42 uint64_t LineNum() const { return mLineNum
; }
43 uint64_t LinePos() const { return mLinePos
; }
44 uint64_t Offset() const { return mOffset
; }
45 uint64_t Length() const { return mLength
; }
48 ~CompilationMessage() = default;
53 } // namespace mozilla
55 #endif // GPU_CompilationMessage_H_