OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
(...skipping 5789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5800 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 5800 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
5801 return ServiceIsolate::IsServiceIsolate(iso); | 5801 return ServiceIsolate::IsServiceIsolate(iso); |
5802 } | 5802 } |
5803 | 5803 |
5804 | 5804 |
5805 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { | 5805 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { |
5806 return ServiceIsolate::WaitForLoadPort(); | 5806 return ServiceIsolate::WaitForLoadPort(); |
5807 } | 5807 } |
5808 | 5808 |
5809 | 5809 |
| 5810 DART_EXPORT int64_t Dart_TimelineGetMicros() { |
| 5811 return OS::GetCurrentMonotonicMicros(); |
| 5812 } |
| 5813 |
| 5814 |
| 5815 #if defined(PRODUCT) |
5810 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( | 5816 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( |
5811 const char* name, | 5817 const char* name, |
5812 Dart_ServiceRequestCallback callback, | 5818 Dart_ServiceRequestCallback callback, |
| 5819 void* user_data) { |
| 5820 return; |
| 5821 } |
| 5822 |
| 5823 |
| 5824 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5825 const char* name, |
| 5826 Dart_ServiceRequestCallback callback, |
| 5827 void* user_data) { |
| 5828 return; |
| 5829 } |
| 5830 |
| 5831 |
| 5832 DART_EXPORT Dart_Handle Dart_SetServiceStreamCallbacks( |
| 5833 Dart_ServiceStreamListenCallback listen_callback, |
| 5834 Dart_ServiceStreamCancelCallback cancel_callback) { |
| 5835 return Api::Success(); |
| 5836 } |
| 5837 |
| 5838 |
| 5839 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
| 5840 const char* event_kind, |
| 5841 const uint8_t* bytes, |
| 5842 intptr_t bytes_length) { |
| 5843 return Api::Success(); |
| 5844 } |
| 5845 |
| 5846 |
| 5847 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) { |
| 5848 return; |
| 5849 } |
| 5850 |
| 5851 |
| 5852 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( |
| 5853 Dart_EmbedderTimelineStartRecording start_recording, |
| 5854 Dart_EmbedderTimelineStopRecording stop_recording) { |
| 5855 return; |
| 5856 } |
| 5857 |
| 5858 |
| 5859 DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer, |
| 5860 void* user_data) { |
| 5861 return false; |
| 5862 } |
| 5863 |
| 5864 |
| 5865 DART_EXPORT void Dart_TimelineEvent(const char* label, |
| 5866 int64_t timestamp0, |
| 5867 int64_t timestamp1_or_async_id, |
| 5868 Dart_Timeline_Event_Type type, |
| 5869 intptr_t argument_count, |
| 5870 const char** argument_names, |
| 5871 const char** argument_values) { |
| 5872 return; |
| 5873 } |
| 5874 #else // defined(PRODUCT) |
| 5875 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( |
| 5876 const char* name, |
| 5877 Dart_ServiceRequestCallback callback, |
5813 void* user_data) { | 5878 void* user_data) { |
5814 if (FLAG_support_service) { | 5879 if (FLAG_support_service) { |
5815 Service::RegisterIsolateEmbedderCallback(name, callback, user_data); | 5880 Service::RegisterIsolateEmbedderCallback(name, callback, user_data); |
5816 } | 5881 } |
5817 } | 5882 } |
5818 | 5883 |
5819 | 5884 |
5820 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5885 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
5821 const char* name, | 5886 const char* name, |
5822 Dart_ServiceRequestCallback callback, | 5887 Dart_ServiceRequestCallback callback, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5859 return Api::NewError( | 5924 return Api::NewError( |
5860 "%s expects 'cancel_callback' to be present in the callback set.", | 5925 "%s expects 'cancel_callback' to be present in the callback set.", |
5861 CURRENT_FUNC); | 5926 CURRENT_FUNC); |
5862 } | 5927 } |
5863 } | 5928 } |
5864 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); | 5929 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); |
5865 return Api::Success(); | 5930 return Api::Success(); |
5866 } | 5931 } |
5867 | 5932 |
5868 | 5933 |
5869 DART_EXPORT int64_t Dart_TimelineGetMicros() { | |
5870 return OS::GetCurrentMonotonicMicros(); | |
5871 } | |
5872 | |
5873 | |
5874 #if defined(PRODUCT) | |
5875 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, | 5934 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
5876 const char* event_kind, | 5935 const char* event_kind, |
5877 const uint8_t* bytes, | 5936 const uint8_t* bytes, |
5878 intptr_t bytes_length) { | |
5879 return Api::Success(); | |
5880 } | |
5881 | |
5882 | |
5883 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) { | |
5884 return; | |
5885 } | |
5886 | |
5887 | |
5888 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( | |
5889 Dart_EmbedderTimelineStartRecording start_recording, | |
5890 Dart_EmbedderTimelineStopRecording stop_recording) { | |
5891 return; | |
5892 } | |
5893 | |
5894 | |
5895 DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer, | |
5896 void* user_data) { | |
5897 return false; | |
5898 } | |
5899 | |
5900 | |
5901 DART_EXPORT void Dart_TimelineEvent(const char* label, | |
5902 int64_t timestamp0, | |
5903 int64_t timestamp1_or_async_id, | |
5904 Dart_Timeline_Event_Type type, | |
5905 intptr_t argument_count, | |
5906 const char** argument_names, | |
5907 const char** argument_values) { | |
5908 return; | |
5909 } | |
5910 #else // defined(PRODUCT) | |
5911 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, | |
5912 const char* event_kind, | |
5913 const uint8_t* bytes, | |
5914 intptr_t bytes_length) { | 5937 intptr_t bytes_length) { |
5915 DARTSCOPE(Thread::Current()); | 5938 DARTSCOPE(Thread::Current()); |
5916 Isolate* I = T->isolate(); | 5939 Isolate* I = T->isolate(); |
5917 if (stream_id == NULL) { | 5940 if (stream_id == NULL) { |
5918 RETURN_NULL_ERROR(stream_id); | 5941 RETURN_NULL_ERROR(stream_id); |
5919 } | 5942 } |
5920 if (event_kind == NULL) { | 5943 if (event_kind == NULL) { |
5921 RETURN_NULL_ERROR(event_kind); | 5944 RETURN_NULL_ERROR(event_kind); |
5922 } | 5945 } |
5923 if (bytes == NULL) { | 5946 if (bytes == NULL) { |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6473 | 6496 |
6474 DART_EXPORT bool Dart_IsPrecompiledRuntime() { | 6497 DART_EXPORT bool Dart_IsPrecompiledRuntime() { |
6475 #if defined(DART_PRECOMPILED_RUNTIME) | 6498 #if defined(DART_PRECOMPILED_RUNTIME) |
6476 return true; | 6499 return true; |
6477 #else | 6500 #else |
6478 return false; | 6501 return false; |
6479 #endif | 6502 #endif |
6480 } | 6503 } |
6481 | 6504 |
6482 } // namespace dart | 6505 } // namespace dart |
OLD | NEW |