Chromium Code Reviews| Index: runtime/bin/vmservice_impl.cc |
| diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc |
| index b35c67e00ed72a974a17a9be38bdfd6fb11efb87..14b49735d93e9f3341c92350d38ff23e759d5810 100644 |
| --- a/runtime/bin/vmservice_impl.cc |
| +++ b/runtime/bin/vmservice_impl.cc |
| @@ -86,11 +86,30 @@ class Resources { |
| const char* VmService::error_msg_ = NULL; |
| +static void* embedder_request_callback_user_data = reinterpret_cast<void*>(0x3); |
| + |
| +static const char* embedder_request_callback(const char* name, |
| + const char** arguments, |
| + intptr_t num_arguments, |
| + const char** option_keys, |
| + const char** option_values, |
| + intptr_t num_options, |
| + void* user_data) { |
| + ASSERT(user_data == embedder_request_callback_user_data); |
| + return strdup("{\"type\": \"EmbedderString\",\"value\":\"Standalone\"}"); |
|
turnidge
2014/02/18 21:27:05
Maybe Embedder or EmbedderId instead of EmbedderSt
Cutch
2014/02/18 22:18:51
Done.
|
| +} |
| + |
| + |
| bool VmService::Start(intptr_t server_port) { |
| bool r = _Start(server_port); |
| if (!r) { |
| return r; |
| } |
| + // Register an embedder provided request callback. |
| + Dart_RegisterServiceRequestCallback( |
| + "_embedder", |
| + embedder_request_callback, |
| + embedder_request_callback_user_data); |
| // Start processing messages in a new thread. |
| dart::Thread::Start(ThreadMain, NULL); |
| return true; |