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

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

Issue 192883004: linux_aura: run IconLoader::ReadIcon on the UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
(...skipping 18 matching lines...) Expand all
29 base::Bind(&IconLoader::OnReadGroup, this)); 29 base::Bind(&IconLoader::OnReadGroup, this));
30 } 30 }
31 31
32 void IconLoader::ReadGroup() { 32 void IconLoader::ReadGroup() {
33 group_ = ReadGroupIDFromFilepath(file_path_); 33 group_ = ReadGroupIDFromFilepath(file_path_);
34 } 34 }
35 35
36 void IconLoader::OnReadGroup() { 36 void IconLoader::OnReadGroup() {
37 if (IsIconMutableFromFilepath(file_path_) || 37 if (IsIconMutableFromFilepath(file_path_) ||
38 !delegate_->OnGroupLoaded(this, group_)) { 38 !delegate_->OnGroupLoaded(this, group_)) {
39 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 39 BrowserThread::PostTask(ReadIconThreadID(), FROM_HERE,
40 base::Bind(&IconLoader::ReadIcon, this)); 40 base::Bind(&IconLoader::ReadIcon, this));
41 } 41 }
42 } 42 }
43 43
44 void IconLoader::NotifyDelegate() { 44 void IconLoader::NotifyDelegate() {
45 // 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
46 // pointer. 46 // pointer.
47 if (delegate_->OnImageLoaded(this, image_.get(), group_)) 47 if (delegate_->OnImageLoaded(this, image_.get(), group_))
48 ignore_result(image_.release()); // Can't ignore return value. 48 ignore_result(image_.release()); // Can't ignore return value.
49 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698