Chromium Code Reviews| 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. |