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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // FrameConsumer implementation. | 54 // FrameConsumer implementation. |
55 virtual void AllocateFrame(media::VideoFrame::Format format, | 55 virtual void AllocateFrame(media::VideoFrame::Format format, |
56 size_t width, | 56 size_t width, |
57 size_t height, | 57 size_t height, |
58 base::TimeDelta timestamp, | 58 base::TimeDelta timestamp, |
59 base::TimeDelta duration, | 59 base::TimeDelta duration, |
60 scoped_refptr<media::VideoFrame>* frame_out, | 60 scoped_refptr<media::VideoFrame>* frame_out, |
61 Task* done); | 61 Task* done); |
62 virtual void ReleaseFrame(media::VideoFrame* frame); | 62 virtual void ReleaseFrame(media::VideoFrame* frame); |
63 virtual void OnPartialFrameOutput(media::VideoFrame* frame, | 63 virtual void OnPartialFrameOutput(media::VideoFrame* frame, |
64 UpdatedRects* rects, | 64 RectVector* rects, |
65 Task* done); | 65 Task* done); |
66 | 66 |
67 // Remove the reference to |instance_| and |view_| by setting the value to | 67 // Remove the reference to |instance_| and |view_| by setting the value to |
68 // NULL. | 68 // NULL. |
69 // This method should only be called on pepper thread. | 69 // This method should only be called on pepper thread. |
70 void Detach(); | 70 void Detach(); |
71 | 71 |
72 private: | 72 private: |
73 // This variable is accessed on chromoting threads and pepper thread. | 73 // This variable is accessed on chromoting threads and pepper thread. |
74 // This is initialized when this object is constructed. Its value is reset | 74 // This is initialized when this object is constructed. Its value is reset |
75 // to NULL on pepper thread when Detach() is called and there will be no | 75 // to NULL on pepper thread when Detach() is called and there will be no |
76 // other threads accessing this variable at the same time. Given the above | 76 // other threads accessing this variable at the same time. Given the above |
77 // conditions locking this variable is not necessary. | 77 // conditions locking this variable is not necessary. |
78 ChromotingInstance* instance_; | 78 ChromotingInstance* instance_; |
79 | 79 |
80 // This variable is only accessed on the pepper thread. Locking is not | 80 // This variable is only accessed on the pepper thread. Locking is not |
81 // necessary. | 81 // necessary. |
82 PepperView* view_; | 82 PepperView* view_; |
83 | 83 |
84 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; | 84 scoped_refptr<base::MessageLoopProxy> plugin_message_loop_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(PepperViewProxy); | 86 DISALLOW_COPY_AND_ASSIGN(PepperViewProxy); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace remoting | 89 } // namespace remoting |
90 | 90 |
91 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_PROXY_H_ | 91 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIEW_PROXY_H_ |
OLD | NEW |