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

Unified Diff: chrome/browser/image_decoder.h

Issue 1844103004: Convert the utility process image decoder into a Mojo service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/image_decoder.h
diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h
index 5f3dbaa9e04ced04edbc90594fdf40c68b7a482e..9c0fa77d6ea9c72f9f33c4eddfdb411961c1cddb 100644
--- a/chrome/browser/image_decoder.h
+++ b/chrome/browser/image_decoder.h
@@ -12,6 +12,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/sequence_checker.h"
#include "base/sequenced_task_runner.h"
#include "base/synchronization/lock.h"
@@ -22,6 +23,14 @@
class SkBitmap;
+namespace mojom {
+class ImageDecoder;
+}
+
+namespace mojo {
+template <typename T> class InterfacePtr;
+}
+
// This is a helper class for decoding images safely in a utility process. To
// use this, call ImageDecoder::Start(...) or
// ImageDecoder::StartWithOptions(...) on any thread.
@@ -155,6 +164,10 @@ class ImageDecoder : public content::UtilityProcessHostClient {
// unless a new decoding request resets the timer.
scoped_ptr<base::DelayTimer> batch_mode_timer_;
+ // Mojo service connection. Must always be bound/reset and used on the IO
+ // thread.
+ scoped_ptr<mojo::InterfacePtr<mojom::ImageDecoder>> decoder_;
jam 2016/03/31 17:46:33 why is this in a scoped ptr instead of having the
Anand Mistry (off Chromium) 2016/04/01 05:35:11 Oops. Artifact of the previous (in components) inc
+
DISALLOW_COPY_AND_ASSIGN(ImageDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698