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

Side by Side Diff: remoting/webapp/crd/js/dns_blackhole_checker.js

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 (function() { 10 (function() {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 onDone: this.onHttpRequestDone_.bind(this) 91 onDone: this.onHttpRequestDone_.bind(this)
92 }); 92 });
93 }; 93 };
94 94
95 remoting.DnsBlackholeChecker.prototype.getState = function() { 95 remoting.DnsBlackholeChecker.prototype.getState = function() {
96 return this.state_; 96 return this.state_;
97 }; 97 };
98 98
99 remoting.DnsBlackholeChecker.prototype.getError = function() { 99 remoting.DnsBlackholeChecker.prototype.getError = function() {
100 if (this.blackholeState_ == BlackholeState.BLOCKED) { 100 if (this.blackholeState_ == BlackholeState.BLOCKED) {
101 return remoting.Error.NOT_AUTHORIZED; 101 return new remoting.Error(remoting.Error.Tag.NOT_AUTHORIZED);
102 } 102 }
103 103
104 return this.signalStrategy_.getError(); 104 return this.signalStrategy_.getError();
105 }; 105 };
106 106
107 remoting.DnsBlackholeChecker.prototype.getJid = function() { 107 remoting.DnsBlackholeChecker.prototype.getJid = function() {
108 base.debug.assert(this.state_ == remoting.SignalStrategy.State.CONNECTED); 108 base.debug.assert(this.state_ == remoting.SignalStrategy.State.CONNECTED);
109 return this.signalStrategy_.getJid(); 109 return this.signalStrategy_.getJid();
110 }; 110 };
111 111
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 * @private 180 * @private
181 */ 181 */
182 remoting.DnsBlackholeChecker.prototype.setState_ = function(newState) { 182 remoting.DnsBlackholeChecker.prototype.setState_ = function(newState) {
183 if (this.state_ != newState) { 183 if (this.state_ != newState) {
184 this.state_ = newState; 184 this.state_ = newState;
185 this.onStateChangedCallback_(this.state_); 185 this.onStateChangedCallback_(this.state_);
186 } 186 }
187 }; 187 };
188 188
189 }()); 189 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698