OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 /** | |
5 * @return {!Promise<!ProductRegistry.Registry>} | |
6 */ | |
7 ProductRegistry.instance = function() { | |
8 if (ProductRegistry._instancePromise) | |
pfeldman
2017/04/27 22:20:49
Replace all this text with:
return self.runtime.e
allada
2017/04/28 01:20:07
Done.
| |
9 return ProductRegistry._instancePromise; | |
10 /** @type {!Promise<!ProductRegistry.Registry>} */ | |
11 ProductRegistry._instancePromise = self.runtime.extension(ProductRegistry.Regi stry).instance().then(instance => { | |
12 ProductRegistry._instance = instance; | |
13 return instance; | |
14 }); | |
15 return ProductRegistry._instancePromise; | |
16 }; | |
17 | |
18 /** | |
19 * @return {?ProductRegistry.Registry} | |
20 */ | |
21 ProductRegistry.existingInstance = function() { | |
pfeldman
2017/04/27 22:20:49
You should not need this.
allada
2017/04/28 01:20:07
Done.
| |
22 return ProductRegistry._instance; | |
23 }; | |
24 | |
25 /** @type {?Promise<!ProductRegistry.Registry>} */ | |
26 ProductRegistry._instancePromise = null; | |
pfeldman
2017/04/27 22:20:49
drop these.
allada
2017/04/28 01:20:07
Done.
| |
27 | |
28 /** @type {?ProductRegistry.Registry} */ | |
29 ProductRegistry._instance = null; | |
30 | |
31 /** | |
32 * @interface | |
33 */ | |
34 ProductRegistry.Registry = function() {}; | |
35 | |
36 ProductRegistry.Registry.prototype = { | |
37 /** | |
38 * @param {!Common.ParsedURL} parsedUrl | |
39 * @return {?string} | |
40 */ | |
41 nameForUrl: function(parsedUrl) {}, | |
42 | |
43 /** | |
44 * @param {!Common.ParsedURL} parsedUrl | |
45 * @return {?ProductRegistry.Registry.ProductEntry} | |
46 */ | |
47 entryForUrl: function(parsedUrl) {}, | |
48 | |
49 /** | |
50 * @param {!Common.ParsedURL} parsedUrl | |
51 * @return {?number} | |
52 */ | |
53 typeForUrl: function(parsedUrl) {}, | |
54 | |
55 /** | |
56 * @param {!SDK.ResourceTreeFrame} frame | |
57 * @return {?ProductRegistry.Registry.ProductEntry} | |
58 */ | |
59 entryForFrame: function(frame) {} | |
60 }; | |
61 | |
62 /** @typedef {!{name: string, type: ?number}} */ | |
63 ProductRegistry.Registry.ProductEntry; | |
OLD | NEW |