Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
| index c6b78b2648233269cf25bccfe6c96195a9550a54..ffa768180f146d699c7593ba904f183ce03f3f72 100644 |
| --- a/runtime/vm/dart_api_impl.cc |
| +++ b/runtime/vm/dart_api_impl.cc |
| @@ -5540,7 +5540,9 @@ DART_EXPORT Dart_Handle Dart_FinalizeLoading(bool complete_futures) { |
| // the new code, the debugger convert them to unresolved source breakpoints. |
| // The code that completes the futures (invoked below) may call into the |
| // newly loaded code and trigger one of these breakpoints. |
| +#ifndef PRODUCT |
| I->debugger()->NotifyDoneLoading(); |
|
rmacnak
2016/02/04 21:26:41
+ FLAG_support_debugger
|
| +#endif // !PRODUCT |
| if (FLAG_enable_mirrors) { |
| // Notify mirrors that MirrorSystem.libraries needs to be recomputed. |
| @@ -5648,7 +5650,9 @@ DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( |
| const char* name, |
| Dart_ServiceRequestCallback callback, |
| void* user_data) { |
| +#ifndef PRODUCT |
| Service::RegisterIsolateEmbedderCallback(name, callback, user_data); |
| +#endif // !PRODUCT |
| } |
| @@ -5656,13 +5660,18 @@ DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| const char* name, |
| Dart_ServiceRequestCallback callback, |
| void* user_data) { |
| +#ifndef PRODUCT |
| Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| +#endif // !PRODUCT |
| } |
| DART_EXPORT Dart_Handle Dart_SetServiceStreamCallbacks( |
| Dart_ServiceStreamListenCallback listen_callback, |
| Dart_ServiceStreamCancelCallback cancel_callback) { |
| +#ifdef PRODUCT |
| + return Api::Success(); |
|
rmacnak
2016/02/04 21:26:41
Should we expect the embedder to also behave a bit
Cutch
2016/02/04 22:12:52
I'm trying to allow 'disabled' API calls to become
|
| +#else |
| if (listen_callback != NULL) { |
| if (Service::stream_listen_callback() != NULL) { |
| return Api::NewError( |
| @@ -5693,6 +5702,7 @@ DART_EXPORT Dart_Handle Dart_SetServiceStreamCallbacks( |
| } |
| Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); |
| return Api::Success(); |
| +#endif // PRODUCT |
| } |
| @@ -5700,6 +5710,9 @@ DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
| const char* event_kind, |
| const uint8_t* bytes, |
| intptr_t bytes_length) { |
| +#ifdef PRODUCT |
| + return Api::Success(); |
| +#else |
| DARTSCOPE(Thread::Current()); |
| Isolate* I = T->isolate(); |
| if (stream_id == NULL) { |
| @@ -5718,6 +5731,7 @@ DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
| Service::SendEmbedderEvent(I, stream_id, event_kind, |
| bytes, bytes_length); |
| return Api::Success(); |
| +#endif // PRODUCT |
| } |
| @@ -5875,6 +5889,9 @@ static bool StreamTraceEvents(Dart_StreamConsumer consumer, |
| DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer, |
| void* user_data) { |
| + if (!FLAG_support_timeline) { |
| + return false; |
| + } |
| Isolate* isolate = Isolate::Current(); |
| CHECK_ISOLATE(isolate); |
| if (consumer == NULL) { |
| @@ -5897,6 +5914,9 @@ DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer, |
| DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer, |
| void* user_data) { |
| + if (!FLAG_support_timeline) { |
| + return false; |
| + } |
| // To support various embedders, it must be possible to call this function |
| // from a thread for which we have not entered an Isolate and set up a Thread |
| // TLS object. Therefore, a Zone may not be available, a StackZone cannot be |