| 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 | 6 * @fileoverview |
| 7 * API for host-list management. | 7 * API for host-list management. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** @suppress {duplicate} */ | 10 /** @suppress {duplicate} */ |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 /** | 73 /** |
| 74 * @private {remoting.HostListApi} | 74 * @private {remoting.HostListApi} |
| 75 */ | 75 */ |
| 76 var instance = null; | 76 var instance = null; |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * @return {!remoting.HostListApi} | 79 * @return {!remoting.HostListApi} |
| 80 */ | 80 */ |
| 81 remoting.HostListApi.getInstance = function() { | 81 remoting.HostListApi.getInstance = function() { |
| 82 if (instance == null) { | 82 if (instance == null) { |
| 83 instance = remoting.settings.USE_GCD ? | 83 if (remoting.settings.USE_GCD) { |
| 84 new remoting.GcdHostListApi() : | 84 var gcdInstance = new remoting.GcdHostListApi(); |
| 85 new remoting.LegacyHostListApi(); | 85 var legacyInstance = new remoting.LegacyHostListApi(); |
| 86 instance = new remoting.CombinedHostListApi(legacyInstance, gcdInstance); |
| 87 } else { |
| 88 instance = new remoting.LegacyHostListApi(); |
| 89 } |
| 86 } | 90 } |
| 87 return instance; | 91 return instance; |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 /** | 94 /** |
| 91 * For testing. | 95 * For testing. |
| 92 * @param {remoting.HostListApi} newInstance | 96 * @param {remoting.HostListApi} newInstance |
| 93 */ | 97 */ |
| 94 remoting.HostListApi.setInstance = function(newInstance) { | 98 remoting.HostListApi.setInstance = function(newInstance) { |
| 95 instance = newInstance; | 99 instance = newInstance; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 112 * | 116 * |
| 113 * hostId: The ID of the newly registered host. | 117 * hostId: The ID of the newly registered host. |
| 114 * | 118 * |
| 115 * @typedef {{ | 119 * @typedef {{ |
| 116 * authCode: string, | 120 * authCode: string, |
| 117 * email: string, | 121 * email: string, |
| 118 * hostId: string | 122 * hostId: string |
| 119 * }} | 123 * }} |
| 120 */ | 124 */ |
| 121 remoting.HostListApi.RegisterResult; | 125 remoting.HostListApi.RegisterResult; |
| OLD | NEW |