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

Unified Diff: remoting/client/jni/display_updater_factory.h

Issue 2338473002: [Remoting Android] JniGlDisplayHandler calls invalidate() on UI thread (Closed)
Patch Set: add null-check in deleter Created 4 years, 3 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: remoting/client/jni/display_updater_factory.h
diff --git a/remoting/client/jni/display_updater_factory.h b/remoting/client/jni/display_updater_factory.h
index 9826e96117137831fd4f7e5d1928deef7508fcdc..881106ffca082eb877ae6fb3e190a246ec76df82 100644
--- a/remoting/client/jni/display_updater_factory.h
+++ b/remoting/client/jni/display_updater_factory.h
@@ -21,13 +21,24 @@ class VideoRenderer;
// returned object should be used on the network thread.
class DisplayUpdaterFactory {
Sergey Ulanov 2016/09/19 21:14:56 Do we need to keep this interface? I think we need
Yuwei 2016/09/19 23:52:10 That's what I have considered. Removed.
public:
- virtual ~DisplayUpdaterFactory() {}
+ // A deleter that calls Destroy() to delete the factory.
Lambros 2016/09/16 01:44:12 Does it make sense for this deleter (and Destroy m
Yuwei 2016/09/16 21:49:44 I don't have a strong opinion. My justifications a
+ struct Deleter {
+ void operator()(DisplayUpdaterFactory* factory) {
+ if (factory) {
+ factory->Destroy();
+ }
+ }
+ };
virtual std::unique_ptr<protocol::CursorShapeStub>
CreateCursorShapeStub() = 0;
virtual std::unique_ptr<protocol::VideoRenderer> CreateVideoRenderer() = 0;
+ // Destroys the factory object and frees the memory.
+ virtual void Destroy() = 0;
+
protected:
+ virtual ~DisplayUpdaterFactory() {}
DisplayUpdaterFactory() {}
private:

Powered by Google App Engine
This is Rietveld 408576698