Chromium Code Reviews| 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 5849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5860 return Api::NewError( | 5860 return Api::NewError( |
| 5861 "%s expects 'cancel_callback' to be present in the callback set.", | 5861 "%s expects 'cancel_callback' to be present in the callback set.", |
| 5862 CURRENT_FUNC); | 5862 CURRENT_FUNC); |
| 5863 } | 5863 } |
| 5864 } | 5864 } |
| 5865 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); | 5865 Service::SetEmbedderStreamCallbacks(listen_callback, cancel_callback); |
| 5866 return Api::Success(); | 5866 return Api::Success(); |
| 5867 } | 5867 } |
| 5868 | 5868 |
| 5869 | 5869 |
| 5870 #if defined(PRODUCT) | |
| 5870 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, | 5871 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, |
| 5871 const char* event_kind, | 5872 const char* event_kind, |
| 5872 const uint8_t* bytes, | 5873 const uint8_t* bytes, |
| 5873 intptr_t bytes_length) { | 5874 intptr_t bytes_length) { |
| 5874 #if defined(PRODUCT) | |
| 5875 return Api::Success(); | 5875 return Api::Success(); |
| 5876 } | |
| 5877 | |
| 5878 | |
| 5879 DART_EXPORT int64_t Dart_TimelineGetMicros() { | |
|
rmacnak
2016/07/13 00:13:34
I would leave this one implemented even in product
siva
2016/07/13 00:15:15
Done.
| |
| 5880 return 0; | |
| 5881 } | |
| 5882 | |
| 5883 | |
| 5884 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) { | |
| 5885 return; | |
| 5886 } | |
| 5887 | |
| 5888 | |
| 5889 DART_EXPORT void Dart_SetEmbedderTimelineCallbacks( | |
| 5890 Dart_EmbedderTimelineStartRecording start_recording, | |
| 5891 Dart_EmbedderTimelineStopRecording stop_recording) { | |
| 5892 return; | |
| 5893 } | |
| 5894 | |
| 5895 | |
| 5896 DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer, | |
| 5897 void* user_data) { | |
| 5898 return false; | |
| 5899 } | |
| 5900 | |
| 5901 | |
| 5902 DART_EXPORT void Dart_TimelineEvent(const char* label, | |
| 5903 int64_t timestamp0, | |
| 5904 int64_t timestamp1_or_async_id, | |
| 5905 Dart_Timeline_Event_Type type, | |
| 5906 intptr_t argument_count, | |
| 5907 const char** argument_names, | |
| 5908 const char** argument_values) { | |
| 5909 return; | |
| 5910 } | |
| 5876 #else // defined(PRODUCT) | 5911 #else // defined(PRODUCT) |
| 5912 DART_EXPORT Dart_Handle Dart_ServiceSendDataEvent(const char* stream_id, | |
| 5913 const char* event_kind, | |
| 5914 const uint8_t* bytes, | |
| 5915 intptr_t bytes_length) { | |
| 5877 DARTSCOPE(Thread::Current()); | 5916 DARTSCOPE(Thread::Current()); |
| 5878 Isolate* I = T->isolate(); | 5917 Isolate* I = T->isolate(); |
| 5879 if (stream_id == NULL) { | 5918 if (stream_id == NULL) { |
| 5880 RETURN_NULL_ERROR(stream_id); | 5919 RETURN_NULL_ERROR(stream_id); |
| 5881 } | 5920 } |
| 5882 if (event_kind == NULL) { | 5921 if (event_kind == NULL) { |
| 5883 RETURN_NULL_ERROR(event_kind); | 5922 RETURN_NULL_ERROR(event_kind); |
| 5884 } | 5923 } |
| 5885 if (bytes == NULL) { | 5924 if (bytes == NULL) { |
| 5886 RETURN_NULL_ERROR(bytes); | 5925 RETURN_NULL_ERROR(bytes); |
| 5887 } | 5926 } |
| 5888 if (bytes_length < 0) { | 5927 if (bytes_length < 0) { |
| 5889 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", | 5928 return Api::NewError("%s expects argument 'bytes_length' to be >= 0.", |
| 5890 CURRENT_FUNC); | 5929 CURRENT_FUNC); |
| 5891 } | 5930 } |
| 5892 Service::SendEmbedderEvent(I, stream_id, event_kind, | 5931 Service::SendEmbedderEvent(I, stream_id, event_kind, |
| 5893 bytes, bytes_length); | 5932 bytes, bytes_length); |
| 5894 return Api::Success(); | 5933 return Api::Success(); |
| 5895 #endif // defined(PRODUCT) | |
| 5896 } | 5934 } |
| 5897 | 5935 |
| 5898 | 5936 |
| 5899 DART_EXPORT int64_t Dart_TimelineGetMicros() { | 5937 DART_EXPORT int64_t Dart_TimelineGetMicros() { |
| 5900 return OS::GetCurrentMonotonicMicros(); | 5938 return OS::GetCurrentMonotonicMicros(); |
| 5901 } | 5939 } |
| 5902 | 5940 |
| 5903 | 5941 |
| 5904 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) { | 5942 DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) { |
| 5905 if (!FLAG_support_timeline) { | 5943 if (!FLAG_support_timeline) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6118 default: | 6156 default: |
| 6119 FATAL("Unknown Dart_Timeline_Event_Type"); | 6157 FATAL("Unknown Dart_Timeline_Event_Type"); |
| 6120 } | 6158 } |
| 6121 event->set_owns_label(true); | 6159 event->set_owns_label(true); |
| 6122 event->SetNumArguments(argument_count); | 6160 event->SetNumArguments(argument_count); |
| 6123 for (intptr_t i = 0; i < argument_count; i++) { | 6161 for (intptr_t i = 0; i < argument_count; i++) { |
| 6124 event->CopyArgument(i, argument_names[i], argument_values[i]); | 6162 event->CopyArgument(i, argument_names[i], argument_values[i]); |
| 6125 } | 6163 } |
| 6126 event->Complete(); | 6164 event->Complete(); |
| 6127 } | 6165 } |
| 6166 #endif // defined(PRODUCT) | |
| 6128 | 6167 |
| 6129 | 6168 |
| 6130 DART_EXPORT void Dart_SetThreadName(const char* name) { | 6169 DART_EXPORT void Dart_SetThreadName(const char* name) { |
| 6131 OSThread* thread = OSThread::Current(); | 6170 OSThread* thread = OSThread::Current(); |
| 6132 if (thread == NULL) { | 6171 if (thread == NULL) { |
| 6133 // VM is shutting down. | 6172 // VM is shutting down. |
| 6134 return; | 6173 return; |
| 6135 } | 6174 } |
| 6136 thread->SetName(name); | 6175 thread->SetName(name); |
| 6137 } | 6176 } |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6440 | 6479 |
| 6441 DART_EXPORT bool Dart_IsPrecompiledRuntime() { | 6480 DART_EXPORT bool Dart_IsPrecompiledRuntime() { |
| 6442 #if defined(DART_PRECOMPILED_RUNTIME) | 6481 #if defined(DART_PRECOMPILED_RUNTIME) |
| 6443 return true; | 6482 return true; |
| 6444 #else | 6483 #else |
| 6445 return false; | 6484 return false; |
| 6446 #endif | 6485 #endif |
| 6447 } | 6486 } |
| 6448 | 6487 |
| 6449 } // namespace dart | 6488 } // namespace dart |
| OLD | NEW |