OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Implements a "generic" RequestHelper that provides a default | 6 * @fileoverview Implements a "generic" RequestHelper that provides a default |
7 * response to unknown requests, and supports registering handlers for known | 7 * response to unknown requests, and supports registering handlers for known |
8 * requests. | 8 * requests. |
9 */ | 9 */ |
10 'use strict'; | 10 'use strict'; |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 return null; | 36 return null; |
37 }; | 37 }; |
38 | 38 |
39 /** | 39 /** |
40 * Registers a handler factory for a given type. | 40 * Registers a handler factory for a given type. |
41 * @param {string} type The request type. | 41 * @param {string} type The request type. |
42 * @param {RequestHandlerFactory} factory A factory that can produce a handler | 42 * @param {RequestHandlerFactory} factory A factory that can produce a handler |
43 * for a request of a given type. | 43 * for a request of a given type. |
44 */ | 44 */ |
45 GenericRequestHelper.prototype.registerHandlerFactory = | 45 GenericRequestHelper.prototype.registerHandlerFactory = function( |
46 function(type, factory) { | 46 type, factory) { |
47 this.handlerFactories_[type] = factory; | 47 this.handlerFactories_[type] = factory; |
48 }; | 48 }; |
OLD | NEW |