Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1366)

Unified Diff: remoting/webapp/crd/js/host_list_api.js

Issue 1094133003: Added (incomplete) implementation of HostListApi using GCD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcd-client-fix
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+};
+
+})();

Powered by Google App Engine
This is Rietveld 408576698