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

Unified Diff: ui/file_manager/image_loader/image_loader.js

Issue 631143002: Fix all type errors in image_loader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/image_loader/image_loader.js
diff --git a/ui/file_manager/image_loader/image_loader.js b/ui/file_manager/image_loader/image_loader.js
index a23c0e671f2bd3697bfda73928b42c4c92dadab9..e45c084a5ec6e2766ab80330ad5ed0f6f7fe308f 100644
--- a/ui/file_manager/image_loader/image_loader.js
+++ b/ui/file_manager/image_loader/image_loader.js
@@ -34,7 +34,9 @@ function ImageLoader() {
});
return requestPromise;
});
- initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_)));
+ initPromises.push(new Promise(function(resolve, reject) {
fukino 2014/10/07 09:52:44 The executor function which is given to Promise co
+ this.cache_.initialize(resolve);
+ }.bind(this)));
// After all initialization promises are done, start the scheduler.
Promise.all(initPromises).then(this.scheduler_.start.bind(this.scheduler_));
@@ -50,7 +52,7 @@ function ImageLoader() {
}.bind(this));
// Listen for incoming requests.
- chrome.extension.onMessageExternal.addListener(
+ chrome.runtime.onMessageExternal.addListener(
function(request, sender, sendResponse) {
if (ImageLoader.ALLOWED_CLIENTS.indexOf(sender.id) !== -1) {
// Sending a response may fail if the receiver already went offline.
@@ -63,7 +65,9 @@ function ImageLoader() {
// Ignore the error.
}
};
- return this.onMessage_(sender.id, request, failSafeSendResponse);
+ return this.onMessage_(sender.id,
+ /** @type {LoadImageRequest} */ (request),
+ failSafeSendResponse);
}
}.bind(this));
}
@@ -84,7 +88,7 @@ ImageLoader.ALLOWED_CLIENTS = [
* an image task.
*
* @param {string} senderId Sender's extension id.
- * @param {Object} request Request message as a hash array.
+ * @param {LoadImageRequest} request Request message as a hash array.
* @param {function(Object)} callback Callback to be called to return response.
* @return {boolean} True if the message channel should stay alive until the
* callback is called.

Powered by Google App Engine
This is Rietveld 408576698