1// Copyright 2017 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_D8_CONSOLE_H_
6#define V8_D8_CONSOLE_H_
7
8#include "src/base/platform/time.h"
9#include "src/debug/debug-interface.h"
10#include "src/debug/interface-types.h"
11
12namespace v8 {
13
14class D8Console : public debug::ConsoleDelegate {
15 public:
16 explicit D8Console(Isolate* isolate);
17
18 private:
19 void Assert(const debug::ConsoleCallArguments& args,
20 const v8::debug::ConsoleContext&) override;
21 void Log(const debug::ConsoleCallArguments& args,
22 const v8::debug::ConsoleContext&) override;
23 void Error(const debug::ConsoleCallArguments& args,
24 const v8::debug::ConsoleContext&) override;
25 void Warn(const debug::ConsoleCallArguments& args,
26 const v8::debug::ConsoleContext&) override;
27 void Info(const debug::ConsoleCallArguments& args,
28 const v8::debug::ConsoleContext&) override;
29 void Debug(const debug::ConsoleCallArguments& args,
30 const v8::debug::ConsoleContext&) override;
31 void Time(const debug::ConsoleCallArguments& args,
32 const v8::debug::ConsoleContext&) override;
33 void TimeEnd(const debug::ConsoleCallArguments& args,
34 const v8::debug::ConsoleContext&) override;
35 void TimeStamp(const debug::ConsoleCallArguments& args,
36 const v8::debug::ConsoleContext&) override;
37 void Trace(const debug::ConsoleCallArguments& args,
38 const v8::debug::ConsoleContext&) override;
39
40 Isolate* isolate_;
41 std::map<std::string, base::TimeTicks> timers_;
42 base::TimeTicks default_timer_;
43};
44
45} // namespace v8
46
47#endif // V8_D8_CONSOLE_H_
48