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

Side by Side Diff: content/renderer/media/video_capture_impl.h

Issue 978993002: Changed thread_checker on VideoCaptureImpl and VideoCaptureImplManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 // VideoCaptureImpl represents a capture device in renderer process. It provides 5 // VideoCaptureImpl represents a capture device in renderer process. It provides
6 // interfaces for clients to Start/Stop capture. It also communicates to clients 6 // interfaces for clients to Start/Stop capture. It also communicates to clients
7 // when buffer is ready, state of capture device is changed. 7 // when buffer is ready, state of capture device is changed.
8 8
9 // VideoCaptureImpl is also a delegate of VideoCaptureMessageFilter which relays 9 // VideoCaptureImpl is also a delegate of VideoCaptureMessageFilter which relays
10 // operation of a capture device to the browser process and receives responses 10 // operation of a capture device to the browser process and receives responses
(...skipping 27 matching lines...) Expand all
38 namespace gpu { 38 namespace gpu {
39 struct MailboxHolder; 39 struct MailboxHolder;
40 } // namespace gpu 40 } // namespace gpu
41 41
42 namespace media { 42 namespace media {
43 class VideoFrame; 43 class VideoFrame;
44 } // namespace media 44 } // namespace media
45 45
46 namespace content { 46 namespace content {
47 47
48 // VideoCaptureImpl is used as a representation of capture device in renderer
49 // process. It provides communication to its clients about the state of the
50 // capture device.
51 // All methods must be called on the IO thread.
mcasas 2015/03/06 19:18:29 Comments for the class are at the file level. Owne
emircan 2015/03/10 23:38:36 I moved the existing comments to here instead.
48 class CONTENT_EXPORT VideoCaptureImpl 52 class CONTENT_EXPORT VideoCaptureImpl
49 : public VideoCaptureMessageFilter::Delegate { 53 : public VideoCaptureMessageFilter::Delegate {
50 public: 54 public:
51 ~VideoCaptureImpl() override; 55 ~VideoCaptureImpl() override;
52 56
53 VideoCaptureImpl(media::VideoCaptureSessionId session_id, 57 VideoCaptureImpl(media::VideoCaptureSessionId session_id,
54 VideoCaptureMessageFilter* filter); 58 VideoCaptureMessageFilter* filter);
55 59
56 // Start listening to IPC messages. 60 // Start listening to IPC messages.
57 void Init(); 61 void Init();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Member params_ represents the video format requested by the 170 // Member params_ represents the video format requested by the
167 // client to this class via StartCapture(). 171 // client to this class via StartCapture().
168 media::VideoCaptureParams params_; 172 media::VideoCaptureParams params_;
169 173
170 // The device's first captured frame timestamp sent from browser process side. 174 // The device's first captured frame timestamp sent from browser process side.
171 base::TimeTicks first_frame_timestamp_; 175 base::TimeTicks first_frame_timestamp_;
172 176
173 bool suspended_; 177 bool suspended_;
174 VideoCaptureState state_; 178 VideoCaptureState state_;
175 179
176 // |weak_factory_| and |thread_checker_| are bound to the IO thread. 180 // Hold a pointer to the IO message loop to check we operate on the right
177 base::ThreadChecker thread_checker_; 181 // thread.
182 scoped_refptr<base::MessageLoopProxy> io_message_loop_;
mcasas 2015/03/06 19:18:29 Make const.
emircan 2015/03/10 23:38:36 This may be overwritten inside Init() method, see
178 183
179 // WeakPtrFactory pointing back to |this| object, for use with 184 // WeakPtrFactory pointing back to |this| object, for use with
180 // media::VideoFrames constructed in OnBufferReceived() from buffers cached 185 // media::VideoFrames constructed in OnBufferReceived() from buffers cached
181 // in |client_buffers_|. 186 // in |client_buffers_|.
182 // NOTE: Weak pointers must be invalidated before all other member variables. 187 // NOTE: Weak pointers must be invalidated before all other member variables.
183 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_; 188 base::WeakPtrFactory<VideoCaptureImpl> weak_factory_;
184 189
185 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl); 190 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImpl);
186 }; 191 };
187 192
188 } // namespace content 193 } // namespace content
189 194
190 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_ 195 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/video_capture_impl.cc » ('j') | content/renderer/media/video_capture_impl_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698