v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
d8-console.h
Go to the documentation of this file.
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_D8_CONSOLE_H_
6#define V8_D8_D8_CONSOLE_H_
7
8#include <map>
9
12
13namespace v8 {
14
15class CpuProfiler;
16
18 public:
19 explicit D8Console(Isolate* isolate);
20 ~D8Console() override;
21
22 CpuProfiler* profiler() const { return profiler_; }
23
24 void DisposeProfiler();
25
26 private:
28 const v8::debug::ConsoleContext&) override;
30 const v8::debug::ConsoleContext&) override;
32 const v8::debug::ConsoleContext&) override;
34 const v8::debug::ConsoleContext&) override;
36 const v8::debug::ConsoleContext&) override;
38 const v8::debug::ConsoleContext&) override;
40 const v8::debug::ConsoleContext& context) override;
42 const v8::debug::ConsoleContext& context) override;
44 const v8::debug::ConsoleContext&) override;
46 const v8::debug::ConsoleContext&) override;
48 const v8::debug::ConsoleContext&) override;
50 const v8::debug::ConsoleContext&) override;
52 const v8::debug::ConsoleContext&) override;
53
55 // Start times for the named timers created with console.time('foo') calls.
56 // Calling console.time() and console.timeEnd() without an explicit timer
57 // name will use the 'default' timer (similar to what the browser does).
58 // See https://console.spec.whatwg.org/#timer-table for the specification.
59 std::map<std::string, base::TimeTicks> timers_;
60 // Origin for the timer used by console.timeStamp() calls.
63 bool profiler_active_{false};
64};
65
66} // namespace v8
67
68#endif // V8_D8_D8_CONSOLE_H_
#define Assert(condition)
CpuProfiler * profiler_
Definition d8-console.h:62
D8Console(Isolate *isolate)
Definition d8-console.cc:89
void Error(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void Debug(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
CpuProfiler * profiler() const
Definition d8-console.h:22
bool profiler_active_
Definition d8-console.h:63
void ProfileEnd(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &context) override
base::TimeTicks origin_
Definition d8-console.h:61
void Trace(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void TimeLog(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void Info(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void Profile(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &context) override
void TimeEnd(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
std::map< std::string, base::TimeTicks > timers_
Definition d8-console.h:59
void Log(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
~D8Console() override
Definition d8-console.cc:92
void DisposeProfiler()
Definition d8-console.cc:94
Isolate * isolate_
Definition d8-console.h:54
void Warn(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void TimeStamp(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
void Time(const debug::ConsoleCallArguments &args, const v8::debug::ConsoleContext &) override
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74