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

Side by Side Diff: runtime/bin/dbg_message.cc

Issue 217693002: - Make ports be less predictable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "bin/dbg_connection.h" 5 #include "bin/dbg_connection.h"
6 #include "bin/dbg_message.h" 6 #include "bin/dbg_message.h"
7 #include "bin/dartutils.h" 7 #include "bin/dartutils.h"
8 #include "bin/thread.h" 8 #include "bin/thread.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 intptr_t MessageParser::GetIntParam(const char* name) const { 61 intptr_t MessageParser::GetIntParam(const char* name) const {
62 const char* params = Params(); 62 const char* params = Params();
63 ASSERT(params != NULL); 63 ASSERT(params != NULL);
64 dart::JSONReader r(params); 64 dart::JSONReader r(params);
65 r.Seek(name); 65 r.Seek(name);
66 ASSERT(r.Type() == dart::JSONReader::kInteger); 66 ASSERT(r.Type() == dart::JSONReader::kInteger);
67 return strtol(r.ValueChars(), NULL, 10); 67 return strtol(r.ValueChars(), NULL, 10);
68 } 68 }
69 69
70 70
71 int64_t MessageParser::GetInt64Param(const char* name) const {
72 const char* params = Params();
73 ASSERT(params != NULL);
74 dart::JSONReader r(params);
75 r.Seek(name);
76 ASSERT(r.Type() == dart::JSONReader::kInteger);
77 return strtoll(r.ValueChars(), NULL, 10);
78 }
79
80
71 intptr_t MessageParser::GetOptIntParam(const char* name, 81 intptr_t MessageParser::GetOptIntParam(const char* name,
72 intptr_t default_val) const { 82 intptr_t default_val) const {
73 const char* params = Params(); 83 const char* params = Params();
74 ASSERT(params != NULL); 84 ASSERT(params != NULL);
75 dart::JSONReader r(params); 85 dart::JSONReader r(params);
76 r.Seek(name); 86 r.Seek(name);
77 if (r.Type() == dart::JSONReader::kInteger) { 87 if (r.Type() == dart::JSONReader::kInteger) {
78 return strtol(r.ValueChars(), NULL, 10); 88 return strtol(r.ValueChars(), NULL, 10);
79 } else { 89 } else {
80 return default_val; 90 return default_val;
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 } else { 1379 } else {
1370 ASSERT(kind == kShutdown); 1380 ASSERT(kind == kShutdown);
1371 RemoveIsolateMsgQueue(isolate_id); 1381 RemoveIsolateMsgQueue(isolate_id);
1372 } 1382 }
1373 } 1383 }
1374 Dart_ExitScope(); 1384 Dart_ExitScope();
1375 } 1385 }
1376 1386
1377 } // namespace bin 1387 } // namespace bin
1378 } // namespace dart 1388 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/dbg_message.h ('k') | runtime/vm/message_handler.cc » ('j') | runtime/vm/port.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698