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

Unified Diff: runtime/bin/http.dart

Issue 10226002: Remove the RequestHandler interface from the HTTP library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | runtime/bin/http_impl.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/http.dart
diff --git a/runtime/bin/http.dart b/runtime/bin/http.dart
index 41a0ac8bdc6a9380e99d717e97b5b89c713f7a9b..11fca2c53a67995eb6cf9b1ab2957c5e151bfd72 100644
--- a/runtime/bin/http.dart
+++ b/runtime/bin/http.dart
@@ -53,15 +53,6 @@ interface HttpStatus {
/**
- * Interface to implement by HTTP request handler classes.
- */
-
-interface RequestHandler {
- void onRequest(HttpRequest request, HttpResponse response);
-}
-
-
-/**
* HTTP server.
*/
interface HttpServer default _HttpServer {
@@ -89,18 +80,20 @@ interface HttpServer default _HttpServer {
* function [matcher] is called with the request and must return
* [:true:] if the [handler] should handle the request. The first
* handler for which [matcher] returns [:true:] will be handed the
- * request. The [handler] can be either an object implementing the
- * [RequestHandler] interface or a function taking two arguments.
+ * request.
*/
- addRequestHandler(bool matcher(HttpRequest request), Object handler);
+ addRequestHandler(bool matcher(HttpRequest request),
+ void handler(HttpRequest request, HttpResponse response));
/**
- * Sets the request handler. This request handler will be called if
- * none of the request handlers registered by [addRequestHandler]
- * matches the current request. If no default request handler is set
- * the server will just respond with status code [:NOT_FOUND:] (404).
+ * Sets the default request handler. This request handler will be
+ * called if none of the request handlers registered by
+ * [addRequestHandler] matches the current request. If no default
+ * request handler is set the server will just respond with status
+ * code [:NOT_FOUND:] (404).
*/
- void set defaultRequestHandler(Object handler);
+ void set defaultRequestHandler(
+ void handler(HttpRequest request, HttpResponse response));
/**
* Stop server listening.
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | runtime/bin/http_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698