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

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

Issue 1829563002: Handle early destruction of CanvasCaptureHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | content/renderer/media/canvas_capture_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ 6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const blink::WebSize& size, 65 const blink::WebSize& size,
66 double frame_rate, 66 double frame_rate,
67 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 67 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
68 blink::WebMediaStreamTrack* track); 68 blink::WebMediaStreamTrack* track);
69 69
70 void CreateNewFrame(const SkImage* image); 70 void CreateNewFrame(const SkImage* image);
71 void AddVideoCapturerSourceToVideoTrack( 71 void AddVideoCapturerSourceToVideoTrack(
72 scoped_ptr<media::VideoCapturerSource> source, 72 scoped_ptr<media::VideoCapturerSource> source,
73 blink::WebMediaStreamTrack* web_track); 73 blink::WebMediaStreamTrack* web_track);
74 74
75 // Implementation VideoCapturerSource that is owned by Blink and delegates
76 // the Start/Stop calls to CanvasCaptureHandler.
77 class VideoCapturerSource;
78
79 // Object that does all the work of running |new_frame_callback_|. 75 // Object that does all the work of running |new_frame_callback_|.
80 // Destroyed on |frame_callback_task_runner_| after the class is destroyed. 76 // Destroyed on |frame_callback_task_runner_| after the class is destroyed.
81 class CanvasCaptureHandlerDelegate; 77 class CanvasCaptureHandlerDelegate;
82 78
83 media::VideoCaptureFormat capture_format_; 79 media::VideoCaptureFormat capture_format_;
84 bool ask_for_new_frame_; 80 bool ask_for_new_frame_;
85 81
86 const blink::WebSize size_; 82 const blink::WebSize size_;
87 gfx::Size last_size; 83 gfx::Size last_size;
88 std::vector<uint8_t> temp_data_; 84 std::vector<uint8_t> temp_data_;
89 size_t row_bytes_; 85 size_t row_bytes_;
90 SkImageInfo image_info_; 86 SkImageInfo image_info_;
91 media::VideoFramePool frame_pool_; 87 media::VideoFramePool frame_pool_;
92 88
93 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 89 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
94 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; 90 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_;
95 91
96 // Bound to Main Render thread. 92 // Bound to Main Render thread.
97 base::ThreadChecker main_render_thread_checker_; 93 base::ThreadChecker main_render_thread_checker_;
98 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; 94 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_;
99 95
100 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); 96 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler);
101 }; 97 };
102 98
103 } // namespace content 99 } // namespace content
104 100
105 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ 101 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/canvas_capture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698