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

Side by Side Diff: dart/pkg/analysis_server/lib/src/protocol.dart

Issue 625923003: Add Domain handler with startup and shutdown stubs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add default empty impls for startup and shutdown Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698