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

Unified Diff: chrome/browser/icon_loader.h

Issue 12211049: Removing base::ThreadRestrictions::ScopedAllowIO from icon_manager_linux.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review changes. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/icon_loader.h
diff --git a/chrome/browser/icon_loader.h b/chrome/browser/icon_loader.h
index ff22c7a056c8995ca6952fbac554d5263c05e70e..37e942489c2905972c6b603e9576188075dbb605 100644
--- a/chrome/browser/icon_loader.h
+++ b/chrome/browser/icon_loader.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop_proxy.h"
@@ -41,16 +42,27 @@ class IconLoader : public base::RefCountedThreadSafe<IconLoader> {
class Delegate {
public:
+ // Invoked when an icon group has been read, but before the icon data
+ // is read. If the icon is already cached, this method will call and return
Robert Sesek 2013/02/13 17:33:05 this method will -> this method SHOULD
shatch 2013/02/21 20:02:06 Done.
+ // the results of OnImageLoaded with the cached image. Callers of
+ // this method are expected to skip the subsequent call to OnImageLoaded
Robert Sesek 2013/02/13 17:33:05 I don't understand this sentence.
shatch 2013/02/21 20:02:06 Done.
+ // if this method succeeds.
+ virtual bool OnGroupLoaded(IconLoader* source,
+ const IconGroupID& group) = 0;
// Invoked when an icon has been read. |source| is the IconLoader. If the
// icon has been successfully loaded, result is non-null. This method must
// return true if it is taking ownership of the returned image.
- virtual bool OnImageLoaded(IconLoader* source, gfx::Image* result) = 0;
+ virtual bool OnImageLoaded(IconLoader* source,
+ gfx::Image* result,
+ const IconGroupID& group) = 0;
protected:
virtual ~Delegate() {}
};
- IconLoader(const IconGroupID& group, IconSize size, Delegate* delegate);
+ IconLoader(const base::FilePath& file_path,
+ IconSize size,
+ Delegate* delegate);
// Start reading the icon on the file thread.
void Start();
@@ -60,6 +72,8 @@ class IconLoader : public base::RefCountedThreadSafe<IconLoader> {
virtual ~IconLoader();
+ void ReadGroup();
+ void OnReadGroup();
void ReadIcon();
void NotifyDelegate();
@@ -67,6 +81,8 @@ class IconLoader : public base::RefCountedThreadSafe<IconLoader> {
// The message loop object of the thread in which we notify the delegate.
scoped_refptr<base::MessageLoopProxy> target_message_loop_;
+ base::FilePath file_path_;
+
IconGroupID group_;
IconSize icon_size_;

Powered by Google App Engine
This is Rietveld 408576698