summaryrefslogtreecommitdiffstats
path: root/app/resource_bundle.cc
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 20:30:47 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 20:30:47 +0000
commit4dcbc1b552d96791b13dc3d876868dae3f8ad09d (patch)
tree82283d5f574dd529990f4a4cf4d5a99e8b2c28b6 /app/resource_bundle.cc
parent7e74015beb3489b46150bdfe055f67c9e2a0c475 (diff)
downloadchromium_src-4dcbc1b552d96791b13dc3d876868dae3f8ad09d.zip
chromium_src-4dcbc1b552d96791b13dc3d876868dae3f8ad09d.tar.gz
chromium_src-4dcbc1b552d96791b13dc3d876868dae3f8ad09d.tar.bz2
Remove lock.h from resource_bundle.h and histogram.h.
Use a scoped_ptr<Lock> instead of Lock in resource bundle. BUG=none TEST=none Review URL: http://codereview.chromium.org/3038005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/resource_bundle.cc')
-rw-r--r--app/resource_bundle.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc
index d61e83d..c125907 100644
--- a/app/resource_bundle.cc
+++ b/app/resource_bundle.cc
@@ -5,6 +5,7 @@
#include "app/resource_bundle.h"
#include "base/data_pack.h"
+#include "base/lock.h"
#include "base/logging.h"
#include "base/string_piece.h"
#include "build/build_config.h"
@@ -75,7 +76,8 @@ ResourceBundle& ResourceBundle::GetSharedInstance() {
}
ResourceBundle::ResourceBundle()
- : resources_data_(NULL),
+ : lock_(new Lock),
+ resources_data_(NULL),
locale_resources_data_(NULL) {
}
@@ -121,7 +123,7 @@ RefCountedStaticMemory* ResourceBundle::LoadDataResourceBytes(
SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
// Check to see if we already have the Skia image in the cache.
{
- AutoLock lock_scope(lock_);
+ AutoLock lock_scope(*lock_);
SkImageMap::const_iterator found = skia_images_.find(resource_id);
if (found != skia_images_.end())
return found->second;
@@ -133,7 +135,7 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
if (bitmap.get()) {
// We loaded successfully. Cache the Skia version of the bitmap.
- AutoLock lock_scope(lock_);
+ AutoLock lock_scope(*lock_);
// Another thread raced us, and has already cached the skia image.
if (skia_images_.count(resource_id))
@@ -148,7 +150,7 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
LOG(WARNING) << "Unable to load bitmap with id " << resource_id;
NOTREACHED(); // Want to assert in debug mode.
- AutoLock lock_scope(lock_); // Guard empty_bitmap initialization.
+ AutoLock lock_scope(*lock_); // Guard empty_bitmap initialization.
static SkBitmap* empty_bitmap = NULL;
if (!empty_bitmap) {
@@ -164,7 +166,7 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
}
void ResourceBundle::LoadFontsIfNecessary() {
- AutoLock lock_scope(lock_);
+ AutoLock lock_scope(*lock_);
if (!base_font_.get()) {
base_font_.reset(new gfx::Font());