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

Side by Side Diff: lib/src/barback/admin_server.dart

Issue 1765653002: Use the new web_socket_channel package. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | lib/src/barback/web_socket_api.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:http_parser/http_parser.dart';
9 import 'package:shelf/shelf.dart' as shelf; 8 import 'package:shelf/shelf.dart' as shelf;
10 import 'package:shelf_web_socket/shelf_web_socket.dart'; 9 import 'package:shelf_web_socket/shelf_web_socket.dart';
10 import 'package:web_socket_channel/web_socket_channel.dart';
11 11
12 import '../io.dart'; 12 import '../io.dart';
13 import '../log.dart' as log; 13 import '../log.dart' as log;
14 import 'asset_environment.dart'; 14 import 'asset_environment.dart';
15 import 'base_server.dart'; 15 import 'base_server.dart';
16 import 'web_socket_api.dart'; 16 import 'web_socket_api.dart';
17 17
18 /// The web admin interface to pub serve. 18 /// The web admin interface to pub serve.
19 // TODO(rnystrom): Currently this just provides access to the Web Socket API. 19 // TODO(rnystrom): Currently this just provides access to the Web Socket API.
20 // See #16954. 20 // See #16954.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 /// Creates a web socket for [request] which should be an upgrade request. 61 /// Creates a web socket for [request] which should be an upgrade request.
62 void _handleWebSocket(WebSocketChannel channel) { 62 void _handleWebSocket(WebSocketChannel channel) {
63 _webSockets.add(channel); 63 _webSockets.add(channel);
64 var api = new WebSocketApi(channel, environment); 64 var api = new WebSocketApi(channel, environment);
65 api.listen() 65 api.listen()
66 .whenComplete(() => _webSockets.remove(channel)) 66 .whenComplete(() => _webSockets.remove(channel))
67 .catchError(addError); 67 .catchError(addError);
68 } 68 }
69 } 69 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/barback/web_socket_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698