OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/mac/bundle_locations.h" | 12 #include "base/mac/bundle_locations.h" |
13 #include "base/mac/mac_util.h" | |
14 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
15 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
16 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
17 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
18 #include "ui/base/resource/resource_handle.h" | 17 #include "ui/base/resource/resource_handle.h" |
19 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
20 | 19 |
21 namespace ui { | 20 namespace ui { |
22 | 21 |
23 namespace { | 22 namespace { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 143 |
145 // Another thread raced the load and has already cached the image. | 144 // Another thread raced the load and has already cached the image. |
146 if (images_.count(resource_id)) | 145 if (images_.count(resource_id)) |
147 return images_[resource_id]; | 146 return images_[resource_id]; |
148 | 147 |
149 images_[resource_id] = image; | 148 images_[resource_id] = image; |
150 return images_[resource_id]; | 149 return images_[resource_id]; |
151 } | 150 } |
152 | 151 |
153 } // namespace ui | 152 } // namespace ui |
OLD | NEW |