OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // MessageFilter that handles video capture messages and delegates them to | 5 // MessageFilter that handles video capture messages and delegates them to |
6 // video captures. VideoCaptureMessageFilter is operated on IO thread of | 6 // video captures. VideoCaptureMessageFilter is operated on IO thread of |
7 // render process. It intercepts video capture messages and process them on | 7 // render process. It intercepts video capture messages and process them on |
8 // IO thread since these messages are time critical. | 8 // IO thread since these messages are time critical. |
9 | 9 |
10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ | 10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Add a delegate to the map. | 73 // Add a delegate to the map. |
74 void AddDelegate(Delegate* delegate); | 74 void AddDelegate(Delegate* delegate); |
75 | 75 |
76 // Remove a delegate from the map. | 76 // Remove a delegate from the map. |
77 void RemoveDelegate(Delegate* delegate); | 77 void RemoveDelegate(Delegate* delegate); |
78 | 78 |
79 // Send a message asynchronously. | 79 // Send a message asynchronously. |
80 virtual bool Send(IPC::Message* message); | 80 virtual bool Send(IPC::Message* message); |
81 | 81 |
82 // IPC::MessageFilter override. Called on IO thread. | 82 // IPC::MessageFilter override. Called on IO thread. |
83 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 83 virtual bool OnMessageReceived(const IPC::Message& message) override; |
84 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 84 virtual void OnFilterAdded(IPC::Sender* sender) override; |
85 virtual void OnFilterRemoved() OVERRIDE; | 85 virtual void OnFilterRemoved() override; |
86 virtual void OnChannelClosing() OVERRIDE; | 86 virtual void OnChannelClosing() override; |
87 | 87 |
88 protected: | 88 protected: |
89 virtual ~VideoCaptureMessageFilter(); | 89 virtual ~VideoCaptureMessageFilter(); |
90 | 90 |
91 private: | 91 private: |
92 typedef std::map<int32, Delegate*> Delegates; | 92 typedef std::map<int32, Delegate*> Delegates; |
93 | 93 |
94 // Receive a newly created buffer from browser process. | 94 // Receive a newly created buffer from browser process. |
95 void OnBufferCreated(int device_id, | 95 void OnBufferCreated(int device_id, |
96 base::SharedMemoryHandle handle, | 96 base::SharedMemoryHandle handle, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 int32 last_device_id_; | 137 int32 last_device_id_; |
138 | 138 |
139 IPC::Sender* sender_; | 139 IPC::Sender* sender_; |
140 | 140 |
141 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); | 141 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); |
142 }; | 142 }; |
143 | 143 |
144 } // namespace content | 144 } // namespace content |
145 | 145 |
146 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ | 146 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ |
OLD | NEW |