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

Side by Side Diff: remoting/client/render_stub_proxy.h

Issue 2879743002: [CRD iOS] Hook the touch input feedback (Closed)
Patch Set: Use the ui task poster Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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_RENDER_STUB_PROXY_H_
6 #define REMOTING_CLIENT_RENDER_STUB_PROXY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/single_thread_task_runner.h"
11 #include "remoting/client/render_stub.h"
12
13 namespace remoting {
14
15 class QueuedTaskPoster;
16
17 // A class to proxy calls to a RenderStub from one thread to another.
18 class RenderStubProxy : public RenderStub {
19 public:
20 // stub: The render stub being wrapped.
21 // task_runner: The task runner that |stub| should be run on.
22 RenderStubProxy(base::WeakPtr<RenderStub> stub,
23 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
24 ~RenderStubProxy() override;
25
26 // RenderStub overrides.
27 void SetTransformation(const ViewMatrix& transformation) override;
28 void SetCursorPosition(float x, float y) override;
29 void SetCursorVisibility(bool visible) override;
30 void StartInputFeedback(float x, float y, float diameter) override;
31
32 private:
33 void RunTaskOnProperThread(const base::Closure& task,
nicholss 2017/05/12 21:42:40 This method is doing magic task things and I don't
Yuwei 2017/05/13 00:41:52 Done.
34 bool needs_synchronization);
35
36 base::WeakPtr<RenderStub> stub_;
37 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
38 std::unique_ptr<remoting::QueuedTaskPoster> ui_task_poster_;
39
40 // RenderStubProxy is neither copyable nor movable.
41 RenderStubProxy(const RenderStubProxy&) = delete;
42 RenderStubProxy& operator=(const RenderStubProxy&) = delete;
43 };
44
45 } // namespace remoting
46 #endif // REMOTING_CLIENT_RENDER_STUB_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698