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

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

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 using content::BrowserThread; 11 using content::BrowserThread;
12 12
13 IconLoader::IconLoader(const base::FilePath& file_path, IconSize size, 13 IconLoader::IconLoader(const base::FilePath& file_path,
14 IconSize size,
14 Delegate* delegate) 15 Delegate* delegate)
15 : target_message_loop_(NULL), 16 : target_message_loop_(NULL),
16 file_path_(file_path), 17 file_path_(file_path),
17 icon_size_(size), 18 icon_size_(size),
18 image_(NULL), 19 delegate_(delegate) {}
19 delegate_(delegate) {
20 }
21 20
22 IconLoader::~IconLoader() { 21 IconLoader::~IconLoader() {
23 } 22 }
24 23
25 void IconLoader::Start() { 24 void IconLoader::Start() {
26 target_message_loop_ = base::MessageLoopProxy::current(); 25 target_message_loop_ = base::MessageLoopProxy::current();
27 26
28 BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE, 27 BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
29 base::Bind(&IconLoader::ReadGroup, this), 28 base::Bind(&IconLoader::ReadGroup, this),
30 base::Bind(&IconLoader::OnReadGroup, this)); 29 base::Bind(&IconLoader::OnReadGroup, this));
(...skipping 10 matching lines...) Expand all
41 base::Bind(&IconLoader::ReadIcon, this)); 40 base::Bind(&IconLoader::ReadIcon, this));
42 } 41 }
43 } 42 }
44 43
45 void IconLoader::NotifyDelegate() { 44 void IconLoader::NotifyDelegate() {
46 // If the delegate takes ownership of the Image, release it from the scoped 45 // If the delegate takes ownership of the Image, release it from the scoped
47 // pointer. 46 // pointer.
48 if (delegate_->OnImageLoaded(this, image_.get(), group_)) 47 if (delegate_->OnImageLoaded(this, image_.get(), group_))
49 ignore_result(image_.release()); // Can't ignore return value. 48 ignore_result(image_.release()); // Can't ignore return value.
50 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698