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

Side by Side Diff: remoting/webapp/base/js/client_session.js

Issue 1397463003: Report the Auth method for me2me connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class handling creation and teardown of a remoting client session. 7 * Class handling creation and teardown of a remoting client session.
8 * 8 *
9 * The ClientSession class controls lifetime of the client plugin 9 * The ClientSession class controls lifetime of the client plugin
10 * object and provides the plugin with the functionality it needs to 10 * object and provides the plugin with the functionality it needs to
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 new base.RepeatingTimer(this.reportStatistics.bind(this), 1000)); 543 new base.RepeatingTimer(this.reportStatistics.bind(this), 1000));
544 if (this.plugin_.hasCapability( 544 if (this.plugin_.hasCapability(
545 remoting.ClientSession.Capability.TOUCH_EVENTS)) { 545 remoting.ClientSession.Capability.TOUCH_EVENTS)) {
546 this.plugin_.enableTouchEvents(true); 546 this.plugin_.enableTouchEvents(true);
547 } 547 }
548 } else if (this.isFinished()) { 548 } else if (this.isFinished()) {
549 base.dispose(this.connectedDisposables_); 549 base.dispose(this.connectedDisposables_);
550 this.connectedDisposables_ = null; 550 this.connectedDisposables_ = null;
551 } 551 }
552 552
553 this.logAuthMethod_();
553 this.notifyStateChanges_(oldState, this.state_); 554 this.notifyStateChanges_(oldState, this.state_);
554 // Record state count in an UMA enumerated histogram. 555 // Record state count in an UMA enumerated histogram.
555 recordState(this.state_); 556 recordState(this.state_);
556 this.logger_.logClientSessionStateChange( 557 this.logger_.logClientSessionStateChange(
557 this.state_, this.error_, this.xmppErrorCache_.getFirstError()); 558 this.state_, this.error_, this.xmppErrorCache_.getFirstError());
558 }; 559 };
559 560
561 /** @private */
562 remoting.ClientSession.prototype.logAuthMethod_ = function() {
563 // The AuthMethod is undefined before the AUTHENTICATED stage for a
564 // successful connection or the FAILED stage for a failed connection.
565 if (this.state_ == remoting.ClientSession.State.AUTHENTICATED ||
566 this.state_ == remoting.ClientSession.State.FAILED) {
567 var authMethod = this.credentialsProvider_.getAuthMethod();
568 if (authMethod != null) {
569 this.logger_.setAuthMethod(authMethod);
570 }
571 }
572 };
573
560 /** 574 /**
561 * Records a Chromoting Connection State, stored in an UMA enumerated histogram. 575 * Records a Chromoting Connection State, stored in an UMA enumerated histogram.
562 * @param {remoting.ClientSession.State} state State identifier. 576 * @param {remoting.ClientSession.State} state State identifier.
563 */ 577 */
564 function recordState(state) { 578 function recordState(state) {
565 // According to src/base/metrics/histogram.h, for a UMA enumerated histogram, 579 // According to src/base/metrics/histogram.h, for a UMA enumerated histogram,
566 // the upper limit should be 1 above the max-enum. 580 // the upper limit should be 1 above the max-enum.
567 var histogram_max = remoting.ClientSession.State.MAX_STATE_ENUM - 581 var histogram_max = remoting.ClientSession.State.MAX_STATE_ENUM -
568 remoting.ClientSession.State.MIN_STATE_ENUM + 1; 582 remoting.ClientSession.State.MIN_STATE_ENUM + 1;
569 583
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 } else if (previous == State.CONNECTED && current == State.FAILED) { 667 } else if (previous == State.CONNECTED && current == State.FAILED) {
654 return State.CONNECTION_DROPPED; 668 return State.CONNECTION_DROPPED;
655 } 669 }
656 return current; 670 return current;
657 }; 671 };
658 672
659 /** @private */ 673 /** @private */
660 remoting.ClientSession.prototype.reportStatistics = function() { 674 remoting.ClientSession.prototype.reportStatistics = function() {
661 this.logger_.logStatistics(this.plugin_.getPerfStats()); 675 this.logger_.logStatistics(this.plugin_.getPerfStats());
662 }; 676 };
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/chromoting_event.js ('k') | remoting/webapp/base/js/credentials_provider.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698