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

Side by Side Diff: ui/file_manager/image_loader/image_loader_client.js

Issue 575313004: Compiling file_manager, part 2: remove all warnings not caused by Object.freeze()-like enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_file_manager
Patch Set: rebase Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Client used to connect to the remote ImageLoader extension. Client class runs 8 * Client used to connect to the remote ImageLoader extension. Client class runs
9 * in the extension, where the client.js is included (eg. Files.app). 9 * in the extension, where the client.js is included (eg. Files.app).
10 * It sends remote requests using IPC to the ImageLoader class and forwards 10 * It sends remote requests using IPC to the ImageLoader class and forwards
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 }; 116 };
117 117
118 /** 118 /**
119 * Loads and resizes and image. Use opt_isValid to easily cancel requests 119 * Loads and resizes and image. Use opt_isValid to easily cancel requests
120 * which are not valid anymore, which will reduce cpu consumption. 120 * which are not valid anymore, which will reduce cpu consumption.
121 * 121 *
122 * @param {string} url Url of the requested image. 122 * @param {string} url Url of the requested image.
123 * @param {function} callback Callback used to return response. 123 * @param {function} callback Callback used to return response.
124 * @param {Object=} opt_options Loader options, such as: scale, maxHeight, 124 * @param {Object=} opt_options Loader options, such as: scale, maxHeight,
125 * width, height and/or cache. 125 * width, height and/or cache.
126 * @param {function=} opt_isValid Function returning false in case 126 * @param {function(): boolean=} opt_isValid Function returning false in case
127 * a request is not valid anymore, eg. parent node has been detached. 127 * a request is not valid anymore, eg. parent node has been detached.
128 * @return {?number} Remote task id or null if loaded from cache. 128 * @return {?number} Remote task id or null if loaded from cache.
129 */ 129 */
130 ImageLoaderClient.prototype.load = function( 130 ImageLoaderClient.prototype.load = function(
131 url, callback, opt_options, opt_isValid) { 131 url, callback, opt_options, opt_isValid) {
132 opt_options = opt_options || {}; 132 opt_options = opt_options || {};
133 opt_isValid = opt_isValid || function() { return true; }; 133 opt_isValid = opt_isValid || function() { return true; };
134 134
135 // Record cache usage. 135 // Record cache usage.
136 ImageLoaderClient.recordPercentage('Cache.Usage', this.cache_.getUsage()); 136 ImageLoaderClient.recordPercentage('Cache.Usage', this.cache_.getUsage());
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 onError(); 360 onError();
361 return; 361 return;
362 } 362 }
363 image.src = result.data; 363 image.src = result.data;
364 onSuccess(); 364 onSuccess();
365 }; 365 };
366 366
367 return ImageLoaderClient.getInstance().load( 367 return ImageLoaderClient.getInstance().load(
368 url, callback, options, opt_isValid); 368 url, callback, options, opt_isValid);
369 }; 369 };
OLDNEW
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/ui/preview_panel.js ('k') | ui/webui/resources/js/cr/ui/dialogs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698