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

Unified Diff: chrome/browser/resources/file_manager/js/photo/mosaic_mode.js

Issue 14623021: Introduce a priority queue to the image loader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 7 years, 7 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: chrome/browser/resources/file_manager/js/photo/mosaic_mode.js
diff --git a/chrome/browser/resources/file_manager/js/photo/mosaic_mode.js b/chrome/browser/resources/file_manager/js/photo/mosaic_mode.js
index 25303d7e7bc181495b61389efcb6eeeede5e19ed..0d3d85df4f80af6965e666e28790f0d1294dd859 100644
--- a/chrome/browser/resources/file_manager/js/photo/mosaic_mode.js
+++ b/chrome/browser/resources/file_manager/js/photo/mosaic_mode.js
@@ -1715,6 +1715,9 @@ Mosaic.Tile.prototype.init = function(metadata, onImageMeasured) {
this.markUnloaded();
this.left_ = null; // Mark as not laid out.
+ // Set higher priority for the selected elements to load them first.
+ var priority = this.getAttribute('selected') ? 1 : 2;
+
// Use embedded thumbnails on Drive, since they have higher resolution.
this.thumbnailLoader_ = new ThumbnailLoader(
this.getItem().getUrl(),
@@ -1723,7 +1726,8 @@ Mosaic.Tile.prototype.init = function(metadata, onImageMeasured) {
undefined, // Media type.
FileType.isOnDrive(this.getItem().getUrl()) ?
ThumbnailLoader.UseEmbedded.USE_EMBEDDED :
- ThumbnailLoader.UseEmbedded.NO_EMBEDDED);
+ ThumbnailLoader.UseEmbedded.NO_EMBEDDED,
+ priority);
var setDimensions = function(width, height) {
if (width > height) {

Powered by Google App Engine
This is Rietveld 408576698