Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/webgpu/Instance.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
5
6
#ifndef WEBGPU_INSTANCE_H_
7
#define WEBGPU_INSTANCE_H_
8
9
#include "mozilla/AlreadyAddRefed.h"
10
#include "mozilla/RefPtr.h"
11
#include "nsCOMPtr.h"
12
#include "ObjectModel.h"
13
14
namespace mozilla {
15
namespace dom {
16
struct WebGPUAdapterDescriptor;
17
} // namespace dom
18
19
namespace webgpu {
20
class Adapter;
21
class InstanceProvider;
22
23
class Instance final
24
    : public nsWrapperCache
25
{
26
public:
27
    WEBGPU_DECL_GOOP(Instance)
28
29
    const nsCOMPtr<nsIGlobalObject> mParent;
30
31
    static RefPtr<Instance> Create(nsIGlobalObject* parent);
32
33
private:
34
    explicit Instance(nsIGlobalObject* parent);
35
    virtual ~Instance();
36
37
public:
38
0
    nsIGlobalObject* GetParentObject() const { return mParent.get(); }
39
40
    already_AddRefed<Adapter> GetAdapter(const dom::WebGPUAdapterDescriptor& desc) const;
41
};
42
43
} // namespace webgpu
44
} // namespace mozilla
45
46
#endif // WEBGPU_INSTANCE_H_