Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 4c04cba04ea5fe673abe48b4a715201a6fefb073..5368495d2ba66471e8c59dbf6cf763662f862f2a 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -25,6 +25,7 @@ |
#include "vm/object.h" |
#include "vm/object_store.h" |
#include "vm/port.h" |
+#include "vm/profiler.h" |
#include "vm/resolver.h" |
#include "vm/reusable_handles.h" |
#include "vm/service.h" |
@@ -5028,6 +5029,30 @@ DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer) { |
} |
+// --- Profiler support --- |
+ |
+DART_EXPORT void Dart_BlockProfiler() { |
+ Isolate* isolate = Isolate::Current(); |
+ CHECK_ISOLATE(isolate); |
+ IsolateProfilerData* profiler_data = isolate->profiler_data(); |
+ if (profiler_data == NULL) { |
+ return; |
+ } |
+ profiler_data->Block(); |
+} |
+ |
+ |
+DART_EXPORT void Dart_UnblockProfiler() { |
+ Isolate* isolate = Isolate::Current(); |
+ CHECK_ISOLATE(isolate); |
+ IsolateProfilerData* profiler_data = isolate->profiler_data(); |
+ if (profiler_data == NULL) { |
+ return; |
+ } |
+ profiler_data->Unblock(); |
+} |
+ |
+ |
// --- Service support --- |
DART_EXPORT Dart_Isolate Dart_GetServiceIsolate(void* callback_data) { |