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

Unified Diff: runtime/vm/service/message.dart

Issue 922163005: Fix HTTP support in vm-service (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « runtime/bin/vmservice_impl.cc ('k') | runtime/vm/service/running_isolates.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/message.dart
diff --git a/runtime/vm/service/message.dart b/runtime/vm/service/message.dart
index 011d57d2ac124706051217e790fa71b6cff5658d..d9755da26b97d7a0538f5eb8e2b7cae2f0cc5187 100644
--- a/runtime/vm/service/message.dart
+++ b/runtime/vm/service/message.dart
@@ -4,6 +4,16 @@
part of vmservice;
+String methodNameFromUri(Uri uri) {
Ivan Posva 2015/02/14 01:09:51 Does this have to be a top-level method?
+ if (uri == null) {
+ return '';
+ }
+ if (uri.pathSegments.length == 0) {
+ return '';
+ }
+ return uri.pathSegments[0];
+}
+
class Message {
final Completer _completer = new Completer.sync();
bool get completed => _completer.isCompleted;
@@ -34,6 +44,10 @@ class Message {
params.addAll(rpcParams);
}
+ Message.fromUri(Uri uri) : method = methodNameFromUri(uri) {
+ params.addAll(uri.queryParameters);
+ }
+
dynamic toJson() {
return {
'path': path,
« no previous file with comments | « runtime/bin/vmservice_impl.cc ('k') | runtime/vm/service/running_isolates.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698