Index: remoting/webapp/background/background.js |
diff --git a/remoting/webapp/background/background.js b/remoting/webapp/background/background.js |
index 5f2678898e2a13f6e782b0c85e16586463091920..919a1f79c8abb0f0aa0a197e2b1f70b41082856f 100644 |
--- a/remoting/webapp/background/background.js |
+++ b/remoting/webapp/background/background.js |
@@ -43,6 +43,23 @@ function initializeAppV2(appLauncher) { |
); |
} |
+/** |
+ * The background service is responsible for listening to incoming connection |
+ * requests from Hangouts and the webapp. |
+ * |
+ * @param {remoting.AppLauncher} appLauncher |
+ */ |
+ function initializeBackgroundService(appLauncher) { |
+ /** @type {remoting.It2MeService} */ |
+ var it2meService = new remoting.It2MeService(appLauncher); |
+ it2meService.init(); |
+ remoting.it2meService = it2meService; |
+ |
+ chrome.runtime.onSuspend.addListener(function() { |
+ it2meService.dispose(); |
Jamie
2014/08/13 01:44:52
Reset remoting.it2meService to null? In fact, it m
kelvinp
2014/08/13 23:44:09
Done.
|
+ }); |
+ } |
+ |
function main() { |
/** @type {remoting.AppLauncher} */ |
var appLauncher = new remoting.V1AppLauncher(); |
@@ -50,6 +67,7 @@ function main() { |
appLauncher = new remoting.V2AppLauncher(); |
initializeAppV2(appLauncher); |
} |
+ initializeBackgroundService(appLauncher); |
} |
window.addEventListener('load', main, false); |