OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // PepperViewProxy is used to invoke PepperView object on pepper thread. It | 5 // PepperViewProxy is used to invoke PepperView object on pepper thread. It |
6 // has the same interface as PepperView. When a method calls is received on | 6 // has the same interface as PepperView. When a method calls is received on |
7 // any chromoting threads it delegates the method call to pepper thread. | 7 // any chromoting threads it delegates the method call to pepper thread. |
8 // It also provide a detach mechanism so that when PepperView object is | 8 // It also provide a detach mechanism so that when PepperView object is |
9 // destroyed PepperViewProxy will not call it anymore. This is important in | 9 // destroyed PepperViewProxy will not call it anymore. This is important in |
10 // providing a safe shutdown of ChromotingInstance and PepperView. | 10 // providing a safe shutdown of ChromotingInstance and PepperView. |
(...skipping 23 matching lines...) Expand all Loading... | |
34 // ChromotingView implementation. | 34 // ChromotingView implementation. |
35 virtual bool Initialize() OVERRIDE; | 35 virtual bool Initialize() OVERRIDE; |
36 virtual void TearDown() OVERRIDE; | 36 virtual void TearDown() OVERRIDE; |
37 virtual void Paint() OVERRIDE; | 37 virtual void Paint() OVERRIDE; |
38 virtual void SetSolidFill(uint32 color) OVERRIDE; | 38 virtual void SetSolidFill(uint32 color) OVERRIDE; |
39 virtual void UnsetSolidFill() OVERRIDE; | 39 virtual void UnsetSolidFill() OVERRIDE; |
40 virtual void SetConnectionState(ConnectionState state) OVERRIDE; | 40 virtual void SetConnectionState(ConnectionState state) OVERRIDE; |
41 virtual void UpdateLoginStatus(bool success, const std::string& info) | 41 virtual void UpdateLoginStatus(bool success, const std::string& info) |
42 OVERRIDE; | 42 OVERRIDE; |
43 virtual void SetViewport(int x, int y, int width, int height) OVERRIDE; | 43 virtual void SetViewport(int x, int y, int width, int height) OVERRIDE; |
44 // This method returns a value, so must run synchronously, so must be | |
45 // called only on the pepper thread. | |
46 virtual gfx::Point ConvertScreenToHost(const gfx::Point& p) const OVERRIDE; | |
47 | 44 |
48 // FrameConsumer implementation. | 45 // FrameConsumer implementation. |
49 virtual void AllocateFrame(media::VideoFrame::Format format, | 46 virtual void AllocateFrame(media::VideoFrame::Format format, |
50 size_t width, | 47 size_t width, |
51 size_t height, | 48 size_t height, |
52 base::TimeDelta timestamp, | 49 base::TimeDelta timestamp, |
53 base::TimeDelta duration, | 50 base::TimeDelta duration, |
54 scoped_refptr<media::VideoFrame>* frame_out, | 51 scoped_refptr<media::VideoFrame>* frame_out, |
55 Task* done); | 52 Task* done); |
56 virtual void ReleaseFrame(media::VideoFrame* frame); | 53 virtual void ReleaseFrame(media::VideoFrame* frame); |
57 virtual void OnPartialFrameOutput(media::VideoFrame* frame, | 54 virtual void OnPartialFrameOutput(media::VideoFrame* frame, |
58 UpdatedRects* rects, | 55 UpdatedRects* rects, |
59 Task* done); | 56 Task* done); |
60 | 57 |
61 void SetScaleToFit(bool scale_to_fit); | 58 void SetScaleToFit(bool scale_to_fit); |
62 | 59 |
60 // This method returns a value, so must run synchronously, so must be | |
61 // called only on the pepper thread. | |
Wez
2011/07/20 00:58:35
nit: How does this differ from the other methods o
garykac
2011/07/20 18:55:28
It returns a value, whereas all the other methods
| |
62 pp::Point ConvertScreenToHost(const pp::Point& p) const; | |
63 | |
63 // Remove the reference to |instance_| and |view_| by setting the value to | 64 // Remove the reference to |instance_| and |view_| by setting the value to |
64 // NULL. | 65 // NULL. |
65 // This method should only be called on pepper thread. | 66 // This method should only be called on pepper thread. |
66 void Detach(); | 67 void Detach(); |
67 | 68 |
68 private: | 69 private: |
69 // This variable is accessed on chromoting threads and pepper thread. | 70 // This variable is accessed on chromoting threads and pepper thread. |
70 // This is initialized when this object is constructed. Its value is reset | 71 // This is initialized when this object is constructed. Its value is reset |
71 // to NULL on pepper thread when Detach() is called and there will be no | 72 // to NULL on pepper thread when Detach() is called and there will be no |
72 // other threads accessing this variable at the same time. Given the above | 73 // other threads accessing this variable at the same time. Given the above |
73 // conditions locking this variable is not necessary. | 74 // conditions locking this variable is not necessary. |
74 ChromotingInstance* instance_; | 75 ChromotingInstance* instance_; |
75 | 76 |
76 // This variable is only accessed on the pepper thread. Locking is not | 77 // This variable is only accessed on the pepper thread. Locking is not |
77 // necessary. | 78 // necessary. |
78 PepperView* view_; | 79 PepperView* view_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(PepperViewProxy); | 81 DISALLOW_COPY_AND_ASSIGN(PepperViewProxy); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace remoting | 84 } // namespace remoting |
84 | 85 |
85 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_PROXY_H_ | 86 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_PROXY_H_ |
OLD | NEW |