mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: Fix slow loading of the Views image cache (see issue #2969)
This commit is contained in:
@ -131,8 +131,9 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (missing_images) {
|
if (missing_images) {
|
||||||
CefPostTask(TID_FILE, base::Bind(&ImageCache::LoadMissing, this, image_info,
|
CefPostTask(TID_FILE_USER_BLOCKING,
|
||||||
images, callback));
|
base::Bind(&ImageCache::LoadMissing, this, image_info, images,
|
||||||
|
callback));
|
||||||
} else {
|
} else {
|
||||||
callback.Run(images);
|
callback.Run(images);
|
||||||
}
|
}
|
||||||
@ -167,7 +168,7 @@ ImageCache::ImageType ImageCache::GetImageType(const std::string& path) {
|
|||||||
void ImageCache::LoadMissing(const ImageInfoSet& image_info,
|
void ImageCache::LoadMissing(const ImageInfoSet& image_info,
|
||||||
const ImageSet& images,
|
const ImageSet& images,
|
||||||
const LoadImagesCallback& callback) {
|
const LoadImagesCallback& callback) {
|
||||||
CEF_REQUIRE_FILE_THREAD();
|
DCHECK(!CefCurrentlyOn(TID_UI) && !CefCurrentlyOn(TID_IO));
|
||||||
|
|
||||||
DCHECK_EQ(image_info.size(), images.size());
|
DCHECK_EQ(image_info.size(), images.size());
|
||||||
|
|
||||||
@ -194,7 +195,7 @@ void ImageCache::LoadMissing(const ImageInfoSet& image_info,
|
|||||||
// static
|
// static
|
||||||
bool ImageCache::LoadImageContents(const ImageInfo& info,
|
bool ImageCache::LoadImageContents(const ImageInfo& info,
|
||||||
ImageContent* content) {
|
ImageContent* content) {
|
||||||
CEF_REQUIRE_FILE_THREAD();
|
DCHECK(!CefCurrentlyOn(TID_UI) && !CefCurrentlyOn(TID_IO));
|
||||||
|
|
||||||
ImageRepSet::const_iterator it = info.reps_.begin();
|
ImageRepSet::const_iterator it = info.reps_.begin();
|
||||||
for (; it != info.reps_.end(); ++it) {
|
for (; it != info.reps_.end(); ++it) {
|
||||||
@ -219,7 +220,7 @@ bool ImageCache::LoadImageContents(const std::string& path,
|
|||||||
bool internal,
|
bool internal,
|
||||||
ImageType* type,
|
ImageType* type,
|
||||||
std::string* contents) {
|
std::string* contents) {
|
||||||
CEF_REQUIRE_FILE_THREAD();
|
DCHECK(!CefCurrentlyOn(TID_UI) && !CefCurrentlyOn(TID_IO));
|
||||||
|
|
||||||
*type = GetImageType(path);
|
*type = GetImageType(path);
|
||||||
if (*type == TYPE_NONE)
|
if (*type == TYPE_NONE)
|
||||||
|
Reference in New Issue
Block a user