Commit-Queue | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
v8::Isolate* isolate = info.GetIsolate();
Why do we get the isolate in two different ways? Can this be used by the call to consoleTimeStamp? Should it be m_inspector->isolate() instead? If they are different, can this line be moved inside the #ifdef?
String16 args[6];
It appears this is only used in the #ifdef; can it be moved inside it?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Why do we get the isolate in two different ways? Can this be used by the call to consoleTimeStamp? Should it be m_inspector->isolate() instead? If they are different, can this line be moved inside the #ifdef?
I think we can use either way. Done. Thanks!
It appears this is only used in the #ifdef; can it be moved inside it?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void V8Console::TimeStamp(const v8::debug::ConsoleCallArguments& info,
This is pretty costly, since you do a lot of string copying independent of whether tracing is turned on, and in case tracing is on, you still do quite a few string copies. How about something like this instead?
```cpp
void V8Console::TimeStamp(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8.inspector"),
"V8Console::TimeStamp");
v8::Isolate* isolate = m_inspector->isolate();
ConsoleHelper helper(info, consoleContext, m_inspector);
v8::Local<v8::String> label = helper.firstArgToString();
m_inspector->client()->consoleTimeStamp(isolate, label);
TRACE_EVENT_END2(
TRACE_DISABLED_BY_DEFAULT("v8.inspector"), "V8Console::TimeStamp", "name",
TRACE_STR_COPY(toProtocolString(isolate, label).utf8().c_str()), "args",
([&]() -> std::unique_ptr<v8::tracing::TracedValue> {
static const char* kNames[] = {"name", "start", "end",
"trackName", "trackGroup", "color"};
auto args = v8::tracing::TracedValue::Create();
for (int i = 1; i < info.Length(); ++i) {
auto name = kNames[i];
auto value = info[i];
if (value->IsNumber()) {
args->SetDouble(name, value.As<v8::Number>()->Value());
} else {
args->SetString(name, toProtocolString(isolate, value).utf8());
}
}
return args;
}));
}
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
void V8Console::TimeStamp(const v8::debug::ConsoleCallArguments& info,
thanks! did something similar while trying to keep it simple with a single call to trace
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I've lost your votes after refactoring to address the comments, PTAnotherL :)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Include extra parameters passed to console.timeStamp in trace event
Per https://docs.google.com/document/d/1AsQTakcWz5zH2UC7DdSmoyd3TQ0Q2JUsabHK_y_p1r8/
No user visible behavior is affected by this CL. The usage of the newly
traced data will be handled competely in the devtools frontend.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |