Chromium Code Reviews| 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..e6bb6defdbc7c596b8ffd583b6b80a62524d3f55 100644 |
| --- a/remoting/client/jni/display_updater_factory.h |
| +++ b/remoting/client/jni/display_updater_factory.h |
| @@ -21,13 +21,22 @@ class VideoRenderer; |
| // returned object should be used on the network thread. |
| class DisplayUpdaterFactory { |
|
Hzj_jie
2016/09/13 19:32:12
Will this class be removed eventually? It looks li
Yuwei
2016/09/13 20:49:40
I'm thinking about removing this class but just no
|
| public: |
| - virtual ~DisplayUpdaterFactory() {} |
| + // A deleter that calls Destroy() to delete the factory. |
| + struct Deleter { |
| + void operator()(DisplayUpdaterFactory* factory) { |
|
Hzj_jie
2016/09/13 19:32:12
if (factory) {
factory->Destroy();
}
I happen t
Yuwei
2016/09/13 20:49:40
Added the null-check.
|
| + 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: |