| OLD | NEW |
| 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 library protocol; | 5 library protocol; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/computer/element.dart' show | 10 import 'package:analysis_server/src/computer/element.dart' show |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 /** | 847 /** |
| 848 * Attempt to handle the given [request]. If the request is not recognized by | 848 * Attempt to handle the given [request]. If the request is not recognized by |
| 849 * this handler, return `null` so that other handlers will be given a chance | 849 * this handler, return `null` so that other handlers will be given a chance |
| 850 * to handle it. Otherwise, return the response that should be passed back to | 850 * to handle it. Otherwise, return the response that should be passed back to |
| 851 * the client. | 851 * the client. |
| 852 */ | 852 */ |
| 853 Response handleRequest(Request request); | 853 Response handleRequest(Request request); |
| 854 } | 854 } |
| 855 | 855 |
| 856 /** | 856 /** |
| 857 * Instances of the class [DomainHandler] implement a [RequestHandler] and |
| 858 * also startup and shutdown methods. |
| 859 */ |
| 860 abstract class DomainHandler extends RequestHandler { |
| 861 /** |
| 862 * Perform any operations associated with the startup of the domain. This |
| 863 * will be called before the first [Request]. |
| 864 */ |
| 865 void startup() { } |
| 866 |
| 867 /** |
| 868 * Perform any operations associated with the shutdown of the domain. It is |
| 869 * not guaranteed that this method will be called. If it is, it will be |
| 870 * called after the last [Request] has been made. |
| 871 */ |
| 872 void shutdown() { } |
| 873 } |
| 874 |
| 875 /** |
| 857 * Instances of the class [Response] represent a response to a request. | 876 * Instances of the class [Response] represent a response to a request. |
| 858 */ | 877 */ |
| 859 class Response { | 878 class Response { |
| 860 /** | 879 /** |
| 861 * The [Response] instance that is returned when a real [Response] cannot | 880 * The [Response] instance that is returned when a real [Response] cannot |
| 862 * be provided at the moment. | 881 * be provided at the moment. |
| 863 */ | 882 */ |
| 864 static final Response DELAYED_RESPONSE = new Response('DELAYED_RESPONSE'); | 883 static final Response DELAYED_RESPONSE = new Response('DELAYED_RESPONSE'); |
| 865 | 884 |
| 866 /** | 885 /** |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); | 1072 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
| 1054 hash = hash ^ (hash >> 11); | 1073 hash = hash ^ (hash >> 11); |
| 1055 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); | 1074 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
| 1056 } | 1075 } |
| 1057 | 1076 |
| 1058 static int hash2(a, b) => finish(combine(combine(0, a), b)); | 1077 static int hash2(a, b) => finish(combine(combine(0, a), b)); |
| 1059 | 1078 |
| 1060 static int hash4(a, b, c, d) => | 1079 static int hash4(a, b, c, d) => |
| 1061 finish(combine(combine(combine(combine(0, a), b), c), d)); | 1080 finish(combine(combine(combine(combine(0, a), b), c), d)); |
| 1062 } | 1081 } |
| OLD | NEW |