Index: src/profiler/profiler-listener.h |
diff --git a/src/profiler/profiler-listener.h b/src/profiler/profiler-listener.h |
index 7e24ceaa8629d4e9bd34446f6237c62008ed43fe..500b7ae6befd11b0942ef3d032423ad185713565 100644 |
--- a/src/profiler/profiler-listener.h |
+++ b/src/profiler/profiler-listener.h |
@@ -79,6 +79,7 @@ class ProfilerListener : public CodeEventListener { |
void RecordDeoptInlinedFrames(CodeEntry* entry, AbstractCode* abstract_code); |
Name* InferScriptName(Name* name, SharedFunctionInfo* info); |
V8_INLINE void DispatchCodeEvent(const CodeEventsContainer& evt_rec) { |
+ base::LockGuard<base::Mutex> guard(&mutex_); |
for (auto observer : observers_) { |
observer->CodeEventHandler(evt_rec); |
} |
@@ -87,6 +88,7 @@ class ProfilerListener : public CodeEventListener { |
StringsStorage function_and_resource_names_; |
std::vector<CodeEntry*> code_entries_; |
std::vector<CodeEventObserver*> observers_; |
+ base::Mutex mutex_; |
DISALLOW_COPY_AND_ASSIGN(ProfilerListener); |
}; |