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 5699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5710 } | 5710 } |
5711 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); | 5711 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); |
5712 return Api::Success(); | 5712 return Api::Success(); |
5713 } | 5713 } |
5714 | 5714 |
5715 | 5715 |
5716 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, | 5716 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
5717 const char* event_kind, | 5717 const char* event_kind, |
5718 const uint8_t* bytes, | 5718 const uint8_t* bytes, |
5719 intptr_t bytes_length) { | 5719 intptr_t bytes_length) { |
5720 #ifdef PRODUCT | 5720 #if defined(PRODUCT) |
5721 return Api::Success(); | 5721 return Api::Success(); |
5722 #else | 5722 #else // defined(PRODUCT) |
5723 DARTSCOPE(Thread::Current()); | 5723 DARTSCOPE(Thread::Current()); |
5724 Isolate* I = T->isolate(); | 5724 Isolate* I = T->isolate(); |
5725 if (stream_id == NULL) { | 5725 if (stream_id == NULL) { |
5726 RETURN_NULL_ERROR(stream_id); | 5726 RETURN_NULL_ERROR(stream_id); |
5727 } | 5727 } |
5728 if (event_kind == NULL) { | 5728 if (event_kind == NULL) { |
5729 RETURN_NULL_ERROR(event_kind); | 5729 RETURN_NULL_ERROR(event_kind); |
5730 } | 5730 } |
5731 if (bytes == NULL) { | 5731 if (bytes == NULL) { |
5732 RETURN_NULL_ERROR(bytes); | 5732 RETURN_NULL_ERROR(bytes); |
5733 } | 5733 } |
5734 if (bytes_length < 0) { | 5734 if (bytes_length < 0) { |
5735 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", | 5735 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", |
5736 CURRENT_FUNC); | 5736 CURRENT_FUNC); |
5737 } | 5737 } |
5738 Service::SendEmbedderEvent(I, stream_id, event_kind, | 5738 Service::SendEmbedderEvent(I, stream_id, event_kind, |
5739 bytes, bytes_length); | 5739 bytes, bytes_length); |
5740 return Api::Success(); | 5740 return Api::Success(); |
5741 #endif // PRODUCT | 5741 #endif // defined(PRODUCT) |
5742 } | 5742 } |
5743 | 5743 |
5744 | 5744 |
5745 DART_EXPORT int64_t Dart_TimelineGetMicros() { | 5745 DART_EXPORT int64_t Dart_TimelineGetMicros() { |
5746 return OS::GetCurrentMonotonicMicros(); | 5746 return OS::GetCurrentMonotonicMicros(); |
5747 } | 5747 } |
5748 | 5748 |
5749 | 5749 |
5750 DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask) { | 5750 DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask) { |
5751 if (!FLAG_support_timeline) { | 5751 if (!FLAG_support_timeline) { |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6170 return Api::Success(); | 6170 return Api::Success(); |
6171 } | 6171 } |
6172 #endif // DART_PRECOMPILER | 6172 #endif // DART_PRECOMPILER |
6173 | 6173 |
6174 | 6174 |
6175 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 6175 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
6176 return Dart::IsRunningPrecompiledCode(); | 6176 return Dart::IsRunningPrecompiledCode(); |
6177 } | 6177 } |
6178 | 6178 |
6179 } // namespace dart | 6179 } // namespace dart |
OLD | NEW |