From aa10ed4df6ee4aefc327009ab09149256c9e32d6 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 28 Apr 2015 08:17:56 +0100 Subject: [PATCH] Bug 1137813 - Part 1. Tidy up some event handler names in Loop's otSdkDriver. r=mikedeboer --- .../loop/content/shared/js/otSdkDriver.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/browser/components/loop/content/shared/js/otSdkDriver.js b/browser/components/loop/content/shared/js/otSdkDriver.js index bb423f1fd73f..33881015a206 100644 --- a/browser/components/loop/content/shared/js/otSdkDriver.js +++ b/browser/components/loop/content/shared/js/otSdkDriver.js @@ -223,18 +223,18 @@ loop.OTSdkDriver = (function() { this._sendTwoWayMediaTelemetry = !!sessionData.sendTwoWayMediaTelemetry; this._setTwoWayMediaStartTime(this.CONNECTION_START_TIME_UNINITIALIZED); - this.session.on("connectionCreated", this._onConnectionCreated.bind(this)); - this.session.on("streamCreated", this._onRemoteStreamCreated.bind(this)); - this.session.on("streamDestroyed", this._onRemoteStreamDestroyed.bind(this)); - this.session.on("connectionDestroyed", - this._onConnectionDestroyed.bind(this)); this.session.on("sessionDisconnected", this._onSessionDisconnected.bind(this)); + this.session.on("connectionCreated", this._onConnectionCreated.bind(this)); + this.session.on("connectionDestroyed", + this._onConnectionDestroyed.bind(this)); + this.session.on("streamCreated", this._onRemoteStreamCreated.bind(this)); + this.session.on("streamDestroyed", this._onRemoteStreamDestroyed.bind(this)); this.session.on("streamPropertyChanged", this._onStreamPropertyChanged.bind(this)); // This starts the actual session connection. this.session.connect(sessionData.apiKey, sessionData.sessionToken, - this._onConnectionComplete.bind(this)); + this._onSessionConnectionCompleted.bind(this)); }, /** @@ -244,8 +244,7 @@ loop.OTSdkDriver = (function() { this.endScreenShare(); if (this.session) { - this.session.off("streamCreated streamDestroyed connectionDestroyed " + - "sessionDisconnected streamPropertyChanged"); + this.session.off("sessionDisconnected streamCreated streamDestroyed connectionCreated connectionDestroyed streamPropertyChanged"); this.session.disconnect(); delete this.session; } @@ -302,7 +301,7 @@ loop.OTSdkDriver = (function() { * * @param {Error} error An OT error object, null if there was no error. */ - _onConnectionComplete: function(error) { + _onSessionConnectionCompleted: function(error) { if (error) { console.error("Failed to complete connection", error); this.dispatcher.dispatch(new sharedActions.ConnectionFailure({