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

Unified Diff: remoting/webapp/me2mom/remoting.js

Issue 7108007: Add basic debug log to host page. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « remoting/webapp/me2mom/debug_log.js ('k') | remoting/webapp/me2mom/remoting_session.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/remoting.js
===================================================================
--- remoting/webapp/me2mom/remoting.js (revision 88003)
+++ remoting/webapp/me2mom/remoting.js (working copy)
@@ -157,20 +157,25 @@
function setHostMode(mode) {
var section = document.getElementById('host-section');
var modes = section.getElementsByClassName('mode');
+ addToDebugLog('Host mode: ' + mode);
setMode_(mode, modes);
}
function setClientMode(mode) {
var section = document.getElementById('client-section');
var modes = section.getElementsByClassName('mode');
+ addToDebugLog('Client mode: ' + mode);
setMode_(mode, modes);
}
function tryShare() {
+ addToDebugLog("Attempting to share...");
if (remoting.oauth2.needsNewAccessToken()) {
+ addToDebugLog("Refreshing token...");
remoting.oauth2.refreshAccessToken(function() {
if (remoting.oauth2.needsNewAccessToken()) {
// If we still need it, we're going to infinite loop.
+ addToDebugLog("Unable to get access token");
throw "Unable to get access token";
}
tryShare();
@@ -205,16 +210,18 @@
setHostMode('unshared');
plugin.parentNode.removeChild(plugin);
} else {
- window.alert('Unknown state -> ' + state);
+ addToDebugLog('Unknown state -> ' + state);
}
}
function cancelShare() {
+ addToDebugLog('Canceling share...');
var plugin = document.getElementById(remoting.HOST_PLUGIN_ID);
plugin.disconnect();
}
function startSession_() {
+ addToDebugLog('Starting session...');
remoting.username = remoting.getItem(remoting.XMPP_LOGIN_NAME);
document.location = 'remoting_session.html';
}
@@ -277,7 +284,7 @@
remoting.oauth2.refreshAccessToken(function() {
if (remoting.oauth2.needsNewAccessToken()) {
// If we still need it, we're going to infinite loop.
- throw "Unable to get access token";
+ throw "Unable to get access token.";
}
tryConnect();
});
« no previous file with comments | « remoting/webapp/me2mom/debug_log.js ('k') | remoting/webapp/me2mom/remoting_session.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698