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 // VideoCaptureImplManager owns VideoCaptureImpl objects. Clients who | 5 // VideoCaptureImplManager owns VideoCaptureImpl objects. Clients who |
6 // want access to a video capture device call UseDevice() to get a handle | 6 // want access to a video capture device call UseDevice() to get a handle |
7 // to VideoCaptureImpl. | 7 // to VideoCaptureImpl. |
8 // | 8 // |
9 // THREADING | 9 // THREADING |
10 // | 10 // |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void UnrefDevice(media::VideoCaptureSessionId id); | 94 void UnrefDevice(media::VideoCaptureSessionId id); |
95 | 95 |
96 // The int is used to count clients of the corresponding VideoCaptureImpl. | 96 // The int is used to count clients of the corresponding VideoCaptureImpl. |
97 typedef std::map<media::VideoCaptureSessionId, | 97 typedef std::map<media::VideoCaptureSessionId, |
98 std::pair<int, linked_ptr<VideoCaptureImpl> > > | 98 std::pair<int, linked_ptr<VideoCaptureImpl> > > |
99 VideoCaptureDeviceMap; | 99 VideoCaptureDeviceMap; |
100 VideoCaptureDeviceMap devices_; | 100 VideoCaptureDeviceMap devices_; |
101 | 101 |
102 scoped_refptr<VideoCaptureMessageFilter> filter_; | 102 scoped_refptr<VideoCaptureMessageFilter> filter_; |
103 | 103 |
104 // Following two members are bound to the render thread. | 104 // Bound to the render thread. |
| 105 base::ThreadChecker thread_checker_; |
| 106 |
| 107 // Bound to the render thread. |
| 108 // NOTE: Weak pointers must be invalidated before all other member variables. |
105 base::WeakPtrFactory<VideoCaptureImplManager> weak_factory_; | 109 base::WeakPtrFactory<VideoCaptureImplManager> weak_factory_; |
106 base::ThreadChecker thread_checker_; | |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); | 111 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); |
109 }; | 112 }; |
110 | 113 |
111 } // namespace content | 114 } // namespace content |
112 | 115 |
113 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ | 116 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ |
OLD | NEW |