OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @constructor | 6 * @constructor |
7 * @class FunctionSequence to invoke steps in sequence | 7 * @class FunctionSequence to invoke steps in sequence |
8 * | 8 * |
9 * @param {Array} steps array of functions to invoke in sequence | 9 * @param {Array} steps array of functions to invoke in sequence |
10 * @param {Object} logger logger | 10 * @param {Object} logger logger |
11 * @param {Function} [callback] callback to invoke on success | 11 * @param {Function} callback callback to invoke on success |
12 * @param {Function} [failureCallback] callback to invoke on failure | 12 * @param {Function} failureCallback callback to invoke on failure |
13 */ | 13 */ |
14 function FunctionSequence(name, steps, logger, callback, failureCallback) { | 14 function FunctionSequence(name, steps, logger, callback, failureCallback) { |
15 // Private variables hidden in closure | 15 // Private variables hidden in closure |
16 this.currentStepIdx_ = -1; | 16 this.currentStepIdx_ = -1; |
17 this.failed_ = false; | 17 this.failed_ = false; |
18 this.steps_ = steps; | 18 this.steps_ = steps; |
19 this.callback_ = callback; | 19 this.callback_ = callback; |
20 this.failureCallback_ = failureCallback; | 20 this.failureCallback_ = failureCallback; |
21 this.logger = logger; | 21 this.logger = logger; |
22 this.name = name; | 22 this.name = name; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 this.nextStep.apply(this, arguments); | 115 this.nextStep.apply(this, arguments); |
116 }; | 116 }; |
117 | 117 |
118 /** | 118 /** |
119 * Add Function object mimics to FunctionSequence | 119 * Add Function object mimics to FunctionSequence |
120 */ | 120 */ |
121 FunctionSequence.prototype.apply_ = function(obj, args) { | 121 FunctionSequence.prototype.apply_ = function(obj, args) { |
122 this.start.apply(this, args); | 122 this.start.apply(this, args); |
123 }; | 123 }; |
124 | 124 |
OLD | NEW |