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

Side by Side Diff: chrome/browser/icon_loader_chromeos.cc

Issue 10378009: Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/icon_loader.h" 5 #include "chrome/browser/icon_loader.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 LAZY_INSTANCE_INITIALIZER; 196 LAZY_INSTANCE_INITIALIZER;
197 int idr = icon_mapper.Get().Lookup(group_, icon_size_); 197 int idr = icon_mapper.Get().Lookup(group_, icon_size_);
198 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 198 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
199 scoped_refptr<base::RefCountedStaticMemory> bytes( 199 scoped_refptr<base::RefCountedStaticMemory> bytes(
200 rb.LoadDataResourceBytes(idr)); 200 rb.LoadDataResourceBytes(idr));
201 DCHECK(bytes.get()); 201 DCHECK(bytes.get());
202 SkBitmap bitmap; 202 SkBitmap bitmap;
203 if (!gfx::PNGCodec::Decode(bytes->front(), bytes->size(), &bitmap)) 203 if (!gfx::PNGCodec::Decode(bytes->front(), bytes->size(), &bitmap))
204 NOTREACHED(); 204 NOTREACHED();
205 image_.reset(new gfx::Image( 205 image_.reset(new gfx::Image(
206 GenerateBitmapWithSize(&bitmap, IconSizeToPixelSize(icon_size_)))); 206 *GenerateBitmapWithSize(&bitmap, IconSizeToPixelSize(icon_size_))));
sky 2012/05/04 16:18:23 Doesn't this leak now?
207 target_message_loop_->PostTask( 207 target_message_loop_->PostTask(
208 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this)); 208 FROM_HERE, base::Bind(&IconLoader::NotifyDelegate, this));
209 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698