anchor.diff:        return debuggerUrl;
       }
   
  -    return http.get(uri).then((response) {
  -      var webSocketDebuggerUrl = _getWebsocketDebuggerUrl(response);
  -      return WebSocket
  -          .connect(webSocketDebuggerUrl)
  -          .then((socket) => new _DevtoolsConnection(socket));
  -    });
  +    var response = await http.get(uri);
  +    var webSocketDebuggerUrl = _getWebsocketDebuggerUrl(response);
  +    var socket = await WebSocket.connect(webSocketDebuggerUrl);
  +    return new _DevtoolsConnection(socket);
     }
   
     Future<Map> request(String request, [Map params = const {}]) {
  
positive.code:     if (gc != null) {
        params['gc'] = 'full';
      }
      return _connection
          .request('getAllocationProfile', params)
          .then((resp) => new AllocationProfile.fromJson(resp));
    }
  
    Future getCoverage(String isolateId, {String targetId}) {
      var params = {'isolateId': isolateId};
      if (targetId != null) {
        params['targetId'] = targetId;
      }
      return _connection
          .request('getCoverage', params)
          .then((resp) => new CodeCoverage.fromJson(resp));
    }
  
    Future resume(String isolateId) =>
        _connection.request('resume', {'isolateId': isolateId});
  
    static Future<VMService> connect(String host, int port) {
      _log.fine('Connecting to host $host on port $port');
  
      // For pre-1.9.0 VM versions attempt to detect if we're talking to a
      // Chromium remote debugging port or the VM observatory.
      var doDetect = new RegExp(r'^1\.[4-8]\.').hasMatch(Platform.version);
      if (doDetect) {
        return http.get('http://$host:$port/json').then((resp) {
          var json = JSON.decode(resp.body);
          if (json is List) {
            return connectToDevtools(host, port);
          }
          return connectToVM(host, port);
        });
      }
  
      // For VM versions >=1.9.0, always connect via websocket protocol.
      return connectToVMWebsocket(host, port);
    }
  
    static Future<VMService> connectToVM(String host, int port) {
      return _VMConnection.connect(host, port).then((c) => new VMService._(c));
    }
  
    static Future<VMService> connectToVMWebsocket(String host, int port) {
      return _VMWebsocketConnection
          .connect(host, port)
          .then((c) => new VMService._(c));
    }
  
    static Future<VMService> connectToDevtools(String host, int port) {
      return _DevtoolsConnection
          .connect(host, port)
          .then((c) => new VMService._(c));
    }
  
    Future close() => _connection.close();
  
negative.code:     return new Future.value(new _VMConnection(uri));
    }
  
    Future<Map> request(String request, [Map params = const {}]) async {
      request = _getLegacyRequest(request, params);
      _log.fine('Send> $uri/$request');
      var response = (await http.get('$uri/$request')).body;
      _log.fine('Recv< $response');
      return response.isEmpty ? {} : JSON.decode(response);
    }
  
    Future close() => new Future.value();
  