Chromium Code Reviews| Index: mojo/public/cpp/system/watcher.cc |
| diff --git a/mojo/public/cpp/system/watcher.cc b/mojo/public/cpp/system/watcher.cc |
| index fc03c5a0a0e8b1f4e41c01b29705d743e051d34c..318470be51bfd9278b9f15e81f6c21d68eca129a 100644 |
| --- a/mojo/public/cpp/system/watcher.cc |
| +++ b/mojo/public/cpp/system/watcher.cc |
| @@ -7,14 +7,17 @@ |
| #include "base/bind.h" |
| #include "base/location.h" |
| #include "base/macros.h" |
| +#include "base/trace_event/heap_profiler.h" |
| #include "mojo/public/c/system/functions.h" |
| namespace mojo { |
| -Watcher::Watcher(scoped_refptr<base::SingleThreadTaskRunner> runner) |
| +Watcher::Watcher(const tracked_objects::Location& from_here, |
| + scoped_refptr<base::SingleThreadTaskRunner> runner) |
| : task_runner_(std::move(runner)), |
| is_default_task_runner_(task_runner_ == |
| base::ThreadTaskRunnerHandle::Get()), |
| + heap_profiler_tag_(from_here.ToString()), |
|
ssid
2017/01/12 21:50:03
Can you please just use file_name() here instead o
Jay Civelli
2017/01/13 01:09:27
Done.
|
| weak_factory_(this) { |
| DCHECK(task_runner_->BelongsToCurrentThread()); |
| weak_self_ = weak_factory_.GetWeakPtr(); |
| @@ -94,6 +97,10 @@ void Watcher::CallOnHandleReady(uintptr_t context, |
| // TODO: Maybe we should also expose |signals_state| through the Watcher API. |
| // Current HandleWatcher users have no need for it, so it's omitted here. |
| Watcher* watcher = reinterpret_cast<Watcher*>(context); |
| + |
| + TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION event( |
| + watcher->heap_profiler_tag_.c_str()); |
| + |
| if ((flags & MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM) && |
| watcher->task_runner_->RunsTasksOnCurrentThread() && |
| watcher->is_default_task_runner_) { |