OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_CLIENT_CURSOR_SHAPE_STUB_PROXY_H_ |
| 6 #define REMOTING_CLIENT_CURSOR_SHAPE_STUB_PROXY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/single_thread_task_runner.h" |
| 11 #include "remoting/protocol/cursor_shape_stub.h" |
| 12 |
| 13 namespace remoting { |
| 14 |
| 15 // A helper class to forward CursorShapeStub function calls from one thread to |
| 16 // another. |
| 17 class CursorShapeStubProxy : public protocol::CursorShapeStub { |
| 18 public: |
| 19 // Function calls will be forwarded to |stub| on the thread of |task_runner|. |
| 20 CursorShapeStubProxy( |
| 21 base::WeakPtr<protocol::CursorShapeStub> stub, |
| 22 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 23 ~CursorShapeStubProxy() override; |
| 24 |
| 25 // CursorShapeStub override. |
| 26 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override; |
| 27 |
| 28 private: |
| 29 base::WeakPtr<protocol::CursorShapeStub> stub_; |
| 30 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(CursorShapeStubProxy); |
| 33 }; |
| 34 |
| 35 } // namespace remoting |
| 36 |
| 37 #endif // REMOTING_CLIENT_CURSOR_SHAPE_STUB_PROXY_H_ |
OLD | NEW |