summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/modules/worklet/WorkletConsole.h
blob: c79f0cbafcd8a8f6db3d834c33b161915ba15e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef WorkletConsole_h
#define WorkletConsole_h

#include "core/frame/ConsoleBase.h"
#include "core/frame/ConsoleTypes.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "platform/heap/Handle.h"

namespace blink {

class ConsoleMessage;
class WorkletGlobalScope;

class WorkletConsole final : public ConsoleBase {
    DEFINE_WRAPPERTYPEINFO();
public:
    static WorkletConsole* create(WorkletGlobalScope* scope)
    {
        return new WorkletConsole(scope);
    }
    ~WorkletConsole() override;

    DECLARE_VIRTUAL_TRACE();

protected:
    ExecutionContext* context() final;
    void reportMessageToConsole(PassRefPtrWillBeRawPtr<ConsoleMessage>) final;

private:
    explicit WorkletConsole(WorkletGlobalScope*);

    RawPtrWillBeMember<WorkletGlobalScope> m_scope;
};

} // namespace blink

#endif // WorkletConsole_h