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

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

Issue 1148563004: Fix all compiler errors found by the new compiler version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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
« no previous file with comments | « ui/file_manager/image_loader/cache_unittest.js ('k') | ui/file_manager/image_loader/request.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * Loads and resizes an image. 6 * Loads and resizes an image.
7 * @constructor 7 * @constructor
8 */ 8 */
9 function ImageLoader() { 9 function ImageLoader() {
10 /** 10 /**
11 * Persistent cache object. 11 * Persistent cache object.
12 * @type {Cache} 12 * @type {ImageCache}
13 * @private 13 * @private
14 */ 14 */
15 this.cache_ = new Cache(); 15 this.cache_ = new ImageCache();
16 16
17 /** 17 /**
18 * Manages pending requests and runs them in order of priorities. 18 * Manages pending requests and runs them in order of priorities.
19 * @type {Scheduler} 19 * @type {Scheduler}
20 * @private 20 * @private
21 */ 21 */
22 this.scheduler_ = new Scheduler(); 22 this.scheduler_ = new Scheduler();
23 23
24 /** 24 /**
25 * Piex loader for RAW images. 25 * Piex loader for RAW images.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 * @private 98 * @private
99 */ 99 */
100 ImageLoader.prototype.onMessage_ = function(senderId, request, callback) { 100 ImageLoader.prototype.onMessage_ = function(senderId, request, callback) {
101 var requestId = senderId + ':' + request.taskId; 101 var requestId = senderId + ':' + request.taskId;
102 if (request.cancel) { 102 if (request.cancel) {
103 // Cancel a task. 103 // Cancel a task.
104 this.scheduler_.remove(requestId); 104 this.scheduler_.remove(requestId);
105 return false; // No callback calls. 105 return false; // No callback calls.
106 } else { 106 } else {
107 // Create a request task and add it to the scheduler (queue). 107 // Create a request task and add it to the scheduler (queue).
108 var requestTask = new Request( 108 var requestTask = new ImageRequest(
109 requestId, this.cache_, this.piexLoader_, request, callback); 109 requestId, this.cache_, this.piexLoader_, request, callback);
110 this.scheduler_.add(requestTask); 110 this.scheduler_.add(requestTask);
111 return true; // Request will call the callback. 111 return true; // Request will call the callback.
112 } 112 }
113 }; 113 };
114 114
115 /** 115 /**
116 * Returns the singleton instance. 116 * Returns the singleton instance.
117 * @return {ImageLoader} ImageLoader object. 117 * @return {ImageLoader} ImageLoader object.
118 */ 118 */
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 sB = sB <= 0.0031308 ? 12.92 * sB : 1.055 * Math.pow(sB, 1 / 2.4) - 0.055; 363 sB = sB <= 0.0031308 ? 12.92 * sB : 1.055 * Math.pow(sB, 1 / 2.4) - 0.055;
364 364
365 // Scale to [0, 255]. 365 // Scale to [0, 255].
366 data[i] = Math.max(0, Math.min(255, sR * 255)); 366 data[i] = Math.max(0, Math.min(255, sR * 255));
367 data[i + 1] = Math.max(0, Math.min(255, sG * 255)); 367 data[i + 1] = Math.max(0, Math.min(255, sG * 255));
368 data[i + 2] = Math.max(0, Math.min(255, sB * 255)); 368 data[i + 2] = Math.max(0, Math.min(255, sB * 255));
369 } 369 }
370 context.putImageData(imageData, 0, 0); 370 context.putImageData(imageData, 0, 0);
371 } 371 }
372 }; 372 };
OLDNEW
« no previous file with comments | « ui/file_manager/image_loader/cache_unittest.js ('k') | ui/file_manager/image_loader/request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698