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

Unified Diff: ios/chrome/browser/snapshots/snapshot_cache.mm

Issue 1141423002: [iOS] Fixed tab snapshot cache refresh issues on iPad. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/snapshots/snapshot_cache.mm
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_cache.mm
index 49bbe14120d4adeef7f2d04d4f7b9089e8036df6..e6223e3759bc9c6feaf85d7ed6ff21898d7d794f 100644
--- a/ios/chrome/browser/snapshots/snapshot_cache.mm
+++ b/ios/chrome/browser/snapshots/snapshot_cache.mm
@@ -7,7 +7,6 @@
#import <UIKit/UIKit.h>
#include "base/critical_closure.h"
-#include "base/mac/bind_objc_block.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -206,14 +205,16 @@ void ConvertAndSaveGreyImage(
base::PostTaskAndReplyWithResult(
web::WebThread::GetMessageLoopProxyForThread(
web::WebThread::FILE_USER_BLOCKING).get(),
- FROM_HERE,
- base::BindBlock(^base::scoped_nsobject<UIImage>() {
+ FROM_HERE, base::BindBlock(^base::scoped_nsobject<UIImage>() {
// Retrieve the image on a high priority thread.
return base::scoped_nsobject<UIImage>([ReadImageFromDisk(
[SnapshotCache imagePathForSessionID:sessionID]) retain]);
}),
base::BindBlock(^(base::scoped_nsobject<UIImage> image) {
- if (image)
+ // The iPad tab switcher is currently using its own memory cache so the
+ // image is not stored in memory here if running on iPad.
+ // The same logic is used on image writes (code below).
+ if (!IsIPadIdiom() && image)
[imageDictionary_ setObject:image forKey:sessionID];
if (callback)
callback(image);
noyau (Ping after 24h) 2015/05/19 21:36:34 Why would we retrieve the image if the callback is
sdefresne 2015/05/20 13:15:12 Changed the method to be a no-op on iPad if there
@@ -225,7 +226,9 @@ void ConvertAndSaveGreyImage(
if (!img || !sessionID)
return;
- // Color snapshots are not used on tablets, so don't keep them in memory.
+ // The iPad tab switcher is currently using its own memory cache so the image
+ // is not stored in memory here if running on iPad.
+ // The same logic is used on image reads (code above).
if (!IsIPadIdiom()) {
[imageDictionary_ setObject:img forKey:sessionID];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698