Chromium Code Reviews| Index: gin/v8_platform.cc |
| diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc |
| index 945eee0cc3d9798730130ebbe44d3d5acb92d4f7..d334332592daee6e59cc76c4c55ea4993031e283 100644 |
| --- a/gin/v8_platform.cc |
| +++ b/gin/v8_platform.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/threading/worker_pool.h" |
| #include "base/trace_event/trace_event.h" |
| #include "gin/per_isolate_data.h" |
| +#include "v8/include/v8-tracing.h" |
| namespace gin { |
| @@ -154,7 +155,11 @@ namespace { |
| class EnabledStateObserverImpl final |
| : public base::trace_event::TraceLog::EnabledStateObserver { |
| public: |
| - EnabledStateObserverImpl() = default; |
| + EnabledStateObserverImpl() { |
| + tracing_category_observer_ = v8::tracing::TracingCategoryObserver::Create(); |
|
alph
2016/10/31 22:48:55
Why it belongs here? It should be an internal clas
|
| + observers_.insert(reinterpret_cast<v8::Platform::TraceStateObserver*>( |
|
alph
2016/10/31 22:48:55
Reinterpret cast between interfaces won't work.
|
| + tracing_category_observer_.get())); |
| + } |
| void OnTraceLogEnabled() final { |
| base::AutoLock lock(mutex_); |
| @@ -192,6 +197,8 @@ class EnabledStateObserverImpl final |
| private: |
| base::Lock mutex_; |
| std::unordered_set<v8::Platform::TraceStateObserver*> observers_; |
| + std::unique_ptr<v8::tracing::TracingCategoryObserver> |
| + tracing_category_observer_; |
| DISALLOW_COPY_AND_ASSIGN(EnabledStateObserverImpl); |
| }; |