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

Unified Diff: samples/chat/chat_server_lib.dart

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 | « samples/calculator/calculator.dart ('k') | samples/clock/balls.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/chat/chat_server_lib.dart
diff --git a/samples/chat/chat_server_lib.dart b/samples/chat/chat_server_lib.dart
index 8103c9c46df9d70518836d9fc254b5847d4b5872..134ed58a5eaa6efc02d1d691f0aa1c47be71a6ed 100644
--- a/samples/chat/chat_server_lib.dart
+++ b/samples/chat/chat_server_lib.dart
@@ -6,6 +6,7 @@
#import("dart:io");
#import("dart:isolate");
#import("dart:json");
+#import("dart:math");
void startChatServer() {
var server = new ChatServer();
@@ -57,7 +58,8 @@ class ServerMain {
class User {
User(this._handle) {
// TODO(sgjesse) Generate more secure and unique session id's.
- _sessionId = "a${(Math.random() * 1000000).toInt()}";
+ var rand = new Random();
+ _sessionId = "a${rand.nextInt(1000000)}";
markActivity();
}
« no previous file with comments | « samples/calculator/calculator.dart ('k') | samples/clock/balls.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698