Merge pull request #8159 from seanchas116/devtools

Record JavaScript calls in DevTools timeline on Node/ipc callback
This commit is contained in:
Kevin Sawicki 2016-12-12 13:50:42 -08:00 committed by GitHub
commit 2e1e893675
2 changed files with 10 additions and 0 deletions

View file

@ -17,6 +17,7 @@
#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/trace_event/trace_event.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_paths.h"
#include "native_mate/dictionary.h"
@ -239,8 +240,15 @@ void NodeBindings::UvRunOnce() {
v8::MicrotasksScope script_scope(env->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
if (!is_browser_)
TRACE_EVENT_BEGIN0("devtools.timeline", "FunctionCall");
// Deal with uv events.
int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
if (!is_browser_)
TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
if (r == 0)
message_loop_->QuitWhenIdle(); // Quit from uv.