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

Unified Diff: remoting/webapp/base/js/fallback_signal_strategy.js

Issue 1285213006: Send connection setup results using XHRs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/base/js/fallback_signal_strategy.js
diff --git a/remoting/webapp/base/js/fallback_signal_strategy.js b/remoting/webapp/base/js/fallback_signal_strategy.js
index e6656f19eb29aba6fb2d425380f966300eca7ab1..0596640ac7c60613d0bdca1cdd70c96e862e94bc 100644
--- a/remoting/webapp/base/js/fallback_signal_strategy.js
+++ b/remoting/webapp/base/js/fallback_signal_strategy.js
@@ -74,7 +74,10 @@ remoting.FallbackSignalStrategy = function(primary,
this.primaryConnectTimerId_ = 0;
/** @private {remoting.Logger} */
- this.logger_ = null;
+ this.logger_ = new remoting.SessionLogger(
+ remoting.ChromotingEvent.Role.CLIENT,
+ remoting.TelemetryEventWriter.Client.write
+ );
/**
* @type {Array<{strategyType: remoting.SignalStrategy.Type,
@@ -155,28 +158,6 @@ remoting.FallbackSignalStrategy.prototype.sendMessage = function(message) {
this.getConnectedSignalStrategy_().sendMessage(message);
};
-/**
- * Send any messages accumulated during connection set-up.
- *
- * @param {remoting.Logger} logToServer The Logger instance for the
- * connection.
- */
-remoting.FallbackSignalStrategy.prototype.sendConnectionSetupResults =
- function(logToServer) {
- this.logger_ = logToServer;
- this.sendConnectionSetupResultsInternal_();
-}
-
-remoting.FallbackSignalStrategy.prototype.sendConnectionSetupResultsInternal_ =
- function() {
- for (var i = 0; i < this.connectionSetupResults_.length; ++i) {
- var result = this.connectionSetupResults_[i];
- this.logger_.logSignalStrategyProgress(result.strategyType,
- result.progress);
- }
- this.connectionSetupResults_ = [];
-};
-
/** @return {remoting.SignalStrategy.State} Current state */
remoting.FallbackSignalStrategy.prototype.getState = function() {
return (this.externalState_ === null)
@@ -357,11 +338,5 @@ remoting.FallbackSignalStrategy.prototype.updateProgress_ = function(
strategy, progress) {
console.log('FallbackSignalStrategy progress: ' + strategy.getType() + ' ' +
progress);
- this.connectionSetupResults_.push({
- 'strategyType': strategy.getType(),
- 'progress': progress
- });
- if (this.logger_) {
- this.sendConnectionSetupResultsInternal_();
- }
+ this.logger_.logSignalStrategyProgress(strategy.getType(), progress);
Jamie 2015/08/14 20:48:00 Right now, this causes errors in the background pa
kelvinp 2015/08/14 21:59:54 I think it is ok to ignore them in the short term
};

Powered by Google App Engine
This is Rietveld 408576698