Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: runtime/bin/vmservice_impl.cc

Issue 170943003: Allow for embedder provided service request handlers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | runtime/include/dart_api.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698