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

Unified Diff: chrome/browser/resources/google_now/utility.js

Issue 22912021: Handling errors from chrome APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 7 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
« no previous file with comments | « chrome/browser/resources/google_now/cards.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/utility.js
diff --git a/chrome/browser/resources/google_now/utility.js b/chrome/browser/resources/google_now/utility.js
index 57db70678714ed73cfce7492e09edc7741411d12..7878ac4652eb23ad494603f35b269bb858a95fe7 100644
--- a/chrome/browser/resources/google_now/utility.js
+++ b/chrome/browser/resources/google_now/utility.js
@@ -504,6 +504,10 @@ function buildAttemptManager(
*/
function planForNext(callback) {
instrumented.storage.local.get(currentDelayStorageKey, function(items) {
+ if (!items) {
+ items = {};
+ items[currentDelayStorageKey] = maximumDelaySeconds;
+ }
console.log('planForNext-get-storage ' + JSON.stringify(items));
scheduleNextAttempt(items[currentDelayStorageKey]);
callback();
@@ -554,15 +558,15 @@ function buildAuthenticationManager() {
/**
* Removes the specified cached token.
* @param {string} token Authentication Token to remove from the cache.
- * @param {function} onSuccess Called on completion.
+ * @param {function} callback Called on completion.
*/
- function removeToken(token, onSuccess) {
+ function removeToken(token, callback) {
instrumented.identity.removeCachedAuthToken({token: token}, function() {
// Removing the token from the cache will change the sign in state.
// Repoll now to check the state and notify listeners.
// This also lets Chrome now about a possible problem with the token.
isSignedIn(function() {});
- onSuccess();
+ callback();
});
}
« no previous file with comments | « chrome/browser/resources/google_now/cards.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698