Chromium Code Reviews| Index: ui/base/resource/resource_bundle_mac.mm |
| diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm |
| index 2dbe9ea26d63a34c08c34a6aa5f861b286f98eb4..75d9ca9e913f0f14099e6cc6ec8006087e5a726c 100644 |
| --- a/ui/base/resource/resource_bundle_mac.mm |
| +++ b/ui/base/resource/resource_bundle_mac.mm |
| @@ -90,18 +90,17 @@ base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale, |
| } |
| gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) { |
| + DCHECK(sequence_checker_.CalledOnValidSequence()); |
| // Check to see if the image is already in the cache. |
| - { |
| - base::AutoLock lock(*images_and_fonts_lock_); |
| - if (images_.count(resource_id)) { |
| - if (!images_[resource_id].HasRepresentation(gfx::Image::kImageRepCocoa)) { |
| - DLOG(WARNING) << "ResourceBundle::GetNativeImageNamed() is returning a" |
| + if (images_.count(resource_id)) { |
|
sky
2017/02/21 18:01:05
Use an iterator to avoid the repeated access? e.g.
tzik
2017/02/22 07:19:21
Done.
|
| + if (!images_[resource_id].HasRepresentation(gfx::Image::kImageRepCocoa)) { |
| + DLOG(WARNING) |
| + << "ResourceBundle::GetNativeImageNamed() is returning a" |
| << " cached gfx::Image that isn't backed by an NSImage. The image" |
| << " will be converted, rather than going through the NSImage loader." |
| << " resource_id = " << resource_id; |
| - } |
| - return images_[resource_id]; |
| } |
| + return images_[resource_id]; |
| } |
| gfx::Image image; |
| @@ -160,7 +159,7 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) { |
| image = gfx::Image(ns_image.release()); |
| } |
| - base::AutoLock lock(*images_and_fonts_lock_); |
| + DCHECK(sequence_checker_.CalledOnValidSequence()); |
| // Another thread raced the load and has already cached the image. |
| if (images_.count(resource_id)) |