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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h

Issue 2691943010: Fix a data race on the ref count of AddToHomescreenDataFetcher (Closed)
Patch Set: +#include. +RetainedRef Created 3 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
« no previous file with comments | « no previous file | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
diff --git a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
index 631b1d0ea96a495bf3fa5fa6269e8903947fcce3..ee209abec54703ea8f3f3f5e3ed94c60dc216ddf 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
+++ b/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h
@@ -14,6 +14,10 @@
#include "content/public/browser/web_contents_observer.h"
#include "third_party/skia/include/core/SkBitmap.h"
+namespace base {
+class TaskRunner;
+}
+
namespace content {
class WebContents;
}
@@ -114,16 +118,18 @@ class AddToHomescreenDataFetcher
// Creates the launcher icon from the given bitmap. shortcut_info_.url is
// used to generate an icon if there is no bitmap in |bitmap_result| or the
// bitmap is not large enough.
- void CreateLauncherIconFromFaviconInBackground(
+ SkBitmap CreateLauncherIconFromFaviconInBackground(
const favicon_base::FaviconRawBitmapResult& bitmap_result);
// Creates the launcher icon from the given |raw_icon|.
void CreateLauncherIcon(const SkBitmap& raw_icon);
- void CreateLauncherIconInBackground(const SkBitmap& raw_icon);
+ SkBitmap CreateLauncherIconInBackground(const SkBitmap& raw_icon);
// Notifies the observer that the shortcut data is all available.
void NotifyObserver(const SkBitmap& icon);
+ scoped_refptr<base::TaskRunner> background_task_runner_;
+
Observer* weak_observer_;
// The icons must only be set on the UI thread for thread safety.
« no previous file with comments | « no previous file | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698