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

Unified Diff: ui/file_manager/video_player/js/cast/caster.js

Issue 823583005: Add type annotations to caster.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « ui/file_manager/externs/chrome_cast.js ('k') | ui/file_manager/video_player/js/error_util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/cast/caster.js
diff --git a/ui/file_manager/video_player/js/cast/caster.js b/ui/file_manager/video_player/js/cast/caster.js
index e4a0d5203ba442441cc582ed865588d09c015bd6..dce51229a75355e6804e77a017dbf442ab474d25 100644
--- a/ui/file_manager/video_player/js/cast/caster.js
+++ b/ui/file_manager/video_player/js/cast/caster.js
@@ -8,6 +8,10 @@
// cast extension. This line prevents an exception on using localStorage.
window.__defineGetter__('localStorage', function() { return {}; });
+/**
+ * @type {string}
+ * @const
+ */
var APPLICATION_ID = '4CCB98DA';
util.addPageLoadHandler(function() {
@@ -42,7 +46,7 @@ function initialize() {
* in background before load. The cast API will load the cast SDK automatically.
* The given callback is executes after the cast SDK extension is initialized.
*
- * @param {function} callback Callback (executed asynchronously).
+ * @param {function()} callback Callback (executed asynchronously).
* @param {boolean=} opt_secondTry Specify true if it's the second call after
* installation of Cast API extension.
*/
@@ -79,7 +83,7 @@ function loadCastAPI(callback, opt_secondTry) {
console.info('Google Cast API extension installed.');
// Loads API again.
- setTimeout(loadCastAPI.bind(null, callback, true));
+ setTimeout(loadCastAPI.bind(null, callback, true), 0);
}.wrap());
}.wrap();
@@ -107,7 +111,7 @@ function onLoadCastExtension(callback, opt_installationOccured) {
metrics.CAST_API_EXTENSION_STATUS.LOADED);
}
- setTimeout(callback); // Runs asynchronously.
+ setTimeout(callback, 0); // Runs asynchronously.
};
if(!chrome.cast || !chrome.cast.isAvailable) {
@@ -164,6 +168,9 @@ function initializeApi() {
}
/**
+ * Called when receiver availability is changed. This method is also called when
+ * initialization is completed.
+ *
* @param {chrome.cast.ReceiverAvailability} availability Availability of casts.
* @param {Array.<Object>} receivers List of casts.
*/
« no previous file with comments | « ui/file_manager/externs/chrome_cast.js ('k') | ui/file_manager/video_player/js/error_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698