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

Side by Side Diff: samples/chat/http_impl.dart

Issue 8992007: Make the repeating argument to timers optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 9 years 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
« no previous file with comments | « samples/chat/chat_server_lib.dart ('k') | samples/socket/SocketExample.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Global constants. 5 // Global constants.
6 class Const { 6 class Const {
7 // Bytes for "HTTP/1.0". 7 // Bytes for "HTTP/1.0".
8 static final HTTP10 = const [72, 84, 84, 80, 47, 49, 46, 48]; 8 static final HTTP10 = const [72, 84, 84, 80, 47, 49, 46, 48];
9 // Bytes for "HTTP/1.1". 9 // Bytes for "HTTP/1.1".
10 static final HTTP11 = const [72, 84, 84, 80, 47, 49, 46, 49]; 10 static final HTTP11 = const [72, 84, 84, 80, 47, 49, 46, 49];
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 SocketConnection socketConn = connections.last(); 1480 SocketConnection socketConn = connections.last();
1481 if (socketConn._idleTime(now).inMilliseconds > 1481 if (socketConn._idleTime(now).inMilliseconds >
1482 DEFAULT_EVICTION_TIMEOUT) { 1482 DEFAULT_EVICTION_TIMEOUT) {
1483 connections.removeLast(); 1483 connections.removeLast();
1484 } else { 1484 } else {
1485 break; 1485 break;
1486 } 1486 }
1487 } 1487 }
1488 }); 1488 });
1489 } 1489 }
1490 _evictionTimer = new Timer(_handleEviction, 10000, true); 1490 _evictionTimer = new Timer.repeating(_handleEviction, 10000);
1491 } 1491 }
1492 1492
1493 // Return connection. 1493 // Return connection.
1494 sockets.addFirst(socketConn); 1494 sockets.addFirst(socketConn);
1495 socketConn._markReturned(); 1495 socketConn._markReturned();
1496 } 1496 }
1497 1497
1498 void set openHandler(void callback(HTTPClientRequest request)) { 1498 void set openHandler(void callback(HTTPClientRequest request)) {
1499 _openHandler = callback; 1499 _openHandler = callback;
1500 } 1500 }
1501 1501
1502 var _openHandler; 1502 var _openHandler;
1503 Map<String, Queue<SocketConnection>> _openSockets; 1503 Map<String, Queue<SocketConnection>> _openSockets;
1504 Timer _evictionTimer; 1504 Timer _evictionTimer;
1505 bool _shutdown; // Has this HTTP client been shutdown? 1505 bool _shutdown; // Has this HTTP client been shutdown?
1506 } 1506 }
OLDNEW
« no previous file with comments | « samples/chat/chat_server_lib.dart ('k') | samples/socket/SocketExample.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698