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

Unified Diff: content/child/notifications/notification_image_loader.h

Issue 897733002: worker: Use standard task-runners to run notification image loader callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whoops Created 5 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 | content/child/notifications/notification_image_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/notifications/notification_image_loader.h
diff --git a/content/child/notifications/notification_image_loader.h b/content/child/notifications/notification_image_loader.h
index a3a723c8cd5b460d9f64a324cadb390f0774cca1..33c615c17c68dbd9dbeba7e780962facd013bb46 100644
--- a/content/child/notifications/notification_image_loader.h
+++ b/content/child/notifications/notification_image_loader.h
@@ -14,6 +14,10 @@
class SkBitmap;
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace blink {
class WebURL;
struct WebURLError;
@@ -41,9 +45,11 @@ class NotificationImageLoader
const NotificationImageLoadedCallback& callback);
// Asynchronously starts loading |image_url|.
- // Must be called on the main thread. |worker_thread_id| identifies the id
- // of the thread on which the callback should be executed upon completion.
- void StartOnMainThread(const blink::WebURL& image_url, int worker_thread_id);
+ // Must be called on the main thread. The callback should be executed by
+ // |worker_task_runner|.
+ void StartOnMainThread(
+ const blink::WebURL& image_url,
+ const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner);
// Returns the SkBitmap resulting from decoding the loaded buffer.
SkBitmap GetDecodedImage() const;
@@ -71,7 +77,7 @@ class NotificationImageLoader
NotificationImageLoadedCallback callback_;
scoped_ptr<blink::WebURLLoader> url_loader_;
- int worker_thread_id_;
+ scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
bool completed_;
std::vector<uint8_t> buffer_;
« no previous file with comments | « no previous file | content/child/notifications/notification_image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698