| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 Assertion support. | 6 * @fileoverview Assertion support. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Verify |condition| is truthy and return |condition| if so. | 10 * Verify |condition| is truthy and return |condition| if so. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 * ... | 86 * ... |
| 87 * ... | 87 * ... |
| 88 * resolver.resolve({hello: 'world'}); | 88 * resolver.resolve({hello: 'world'}); |
| 89 */ | 89 */ |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * @constructor @struct | 92 * @constructor @struct |
| 93 * @template T | 93 * @template T |
| 94 */ | 94 */ |
| 95 function PromiseResolver() { | 95 function PromiseResolver() { |
| 96 /** @private {function(T): void} */ | 96 /** @private {function(T=): void} */ |
| 97 this.resolve_; | 97 this.resolve_; |
| 98 | 98 |
| 99 /** @private {function(*=): void} */ | 99 /** @private {function(*=): void} */ |
| 100 this.reject_; | 100 this.reject_; |
| 101 | 101 |
| 102 /** @private {!Promise<T>} */ | 102 /** @private {!Promise<T>} */ |
| 103 this.promise_ = new Promise(function(resolve, reject) { | 103 this.promise_ = new Promise(function(resolve, reject) { |
| 104 this.resolve_ = resolve; | 104 this.resolve_ = resolve; |
| 105 this.reject_ = reject; | 105 this.reject_ = reject; |
| 106 }.bind(this)); | 106 }.bind(this)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 PromiseResolver.prototype = { | 109 PromiseResolver.prototype = { |
| 110 /** @return {!Promise<T>} */ | 110 /** @return {!Promise<T>} */ |
| 111 get promise() { return this.promise_; }, | 111 get promise() { return this.promise_; }, |
| 112 set promise(p) { assertNotReached(); }, | 112 set promise(p) { assertNotReached(); }, |
| 113 | 113 |
| 114 /** @return {function(T): void} */ | 114 /** @return {function(T=): void} */ |
| 115 get resolve() { return this.resolve_; }, | 115 get resolve() { return this.resolve_; }, |
| 116 set resolve(r) { assertNotReached(); }, | 116 set resolve(r) { assertNotReached(); }, |
| 117 | 117 |
| 118 /** @return {function(*=): void} */ | 118 /** @return {function(*=): void} */ |
| 119 get reject() { return this.reject_; }, | 119 get reject() { return this.reject_; }, |
| 120 set reject(s) { assertNotReached(); }, | 120 set reject(s) { assertNotReached(); }, |
| 121 }; | 121 }; |
| 122 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 122 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 123 // Use of this source code is governed by a BSD-style license that can be | 123 // Use of this source code is governed by a BSD-style license that can be |
| 124 // found in the LICENSE file. | 124 // found in the LICENSE file. |
| (...skipping 11091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11216 // found in the LICENSE file. | 11216 // found in the LICENSE file. |
| 11217 | 11217 |
| 11218 // <include src="../../../../ui/webui/resources/js/i18n_template_no_process.js"> | 11218 // <include src="../../../../ui/webui/resources/js/i18n_template_no_process.js"> |
| 11219 | 11219 |
| 11220 i18nTemplate.process(document, loadTimeData); | 11220 i18nTemplate.process(document, loadTimeData); |
| 11221 // Copyright 2015 The Chromium Authors. All rights reserved. | 11221 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 11222 // Use of this source code is governed by a BSD-style license that can be | 11222 // Use of this source code is governed by a BSD-style license that can be |
| 11223 // found in the LICENSE file. | 11223 // found in the LICENSE file. |
| 11224 | 11224 |
| 11225 window.addEventListener('load', downloads.Manager.onLoad); | 11225 window.addEventListener('load', downloads.Manager.onLoad); |
| OLD | NEW |