Chromium Code Reviews| Index: remoting/webapp/crd/js/host_list_api.js |
| diff --git a/remoting/webapp/crd/js/host_list_api.js b/remoting/webapp/crd/js/host_list_api.js |
| index 9b63ccb71c38a2a29891257a3ee14eeb1a47e26f..7f0d9dff425235b8584bd035c0e9cb5c69b86070 100644 |
| --- a/remoting/webapp/crd/js/host_list_api.js |
| +++ b/remoting/webapp/crd/js/host_list_api.js |
| @@ -7,11 +7,13 @@ |
| * API for host-list management. |
| */ |
| -'use strict'; |
| - |
| /** @suppress {duplicate} */ |
| var remoting = remoting || {}; |
| +(function() { |
| + |
| +'use strict'; |
| + |
| /** @interface */ |
| remoting.HostListApi = function() { |
| }; |
| @@ -20,7 +22,7 @@ remoting.HostListApi = function() { |
| * @param {string} newHostId |
| * @param {string} hostName |
| * @param {string} publicKey |
| - * @param {?string} hostClientId |
| + * @param {string} hostClientId |
| * @return {!Promise<string>} An OAuth2 auth code or the empty string. |
| */ |
| remoting.HostListApi.prototype.register; |
|
Jamie
2015/04/22 23:46:01
This method is not implemented by remoting.HostLis
John Williams
2015/04/23 23:55:42
It's implemented by remoting.HostListApiImpl since
|
| @@ -53,3 +55,30 @@ remoting.HostListApi.prototype.put = |
| */ |
| remoting.HostListApi.prototype.remove = function(hostId) { |
| }; |
| + |
| +/** |
| + * @private {remoting.HostListApi} |
| + */ |
| +var instance = null; |
| + |
| +/** |
| + * @return {!remoting.HostListApi} |
| + */ |
| +remoting.HostListApi.getInstance = function() { |
| + if (instance == null) { |
| + instance = remoting.settings.USE_GCD ? |
| + new remoting.HostListApiGcdImpl() : |
| + new remoting.HostListApiImpl(); |
| + } |
| + return instance; |
| +}; |
| + |
| +/** |
| + * For testing. |
| + * @param {remoting.HostListApi} newInstance |
| + */ |
| +remoting.HostListApi.setInstance = function(newInstance) { |
| + instance = newInstance; |
| +}; |
| + |
| +})(); |