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

Side by Side Diff: content/browser/media/capture/aura_window_capture_machine.h

Issue 1913283004: Aura Window Capture: Ensure capture callback is always run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix hole in ThreadSafeCaptureOracle as well. Created 4 years, 8 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/browser/media/capture/aura_window_capture_machine.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_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 using CaptureFrameCallback = 82 using CaptureFrameCallback =
83 media::ThreadSafeCaptureOracle::CaptureFrameCallback; 83 media::ThreadSafeCaptureOracle::CaptureFrameCallback;
84 84
85 // Response callback for cc::Layer::RequestCopyOfOutput(). 85 // Response callback for cc::Layer::RequestCopyOfOutput().
86 void DidCopyOutput(scoped_refptr<media::VideoFrame> video_frame, 86 void DidCopyOutput(scoped_refptr<media::VideoFrame> video_frame,
87 base::TimeTicks start_time, 87 base::TimeTicks start_time,
88 const CaptureFrameCallback& capture_frame_cb, 88 const CaptureFrameCallback& capture_frame_cb,
89 std::unique_ptr<cc::CopyOutputResult> result); 89 std::unique_ptr<cc::CopyOutputResult> result);
90 90
91 // A helper which does the real work for DidCopyOutput. Returns true if 91 // A helper which does the real work for DidCopyOutput. Returns true if
92 // succeeded. 92 // succeeded and |capture_frame_cb| will be run at some future point. Returns
93 // false on error, and |capture_frame_cb| should be run by the caller (with
94 // failure status).
93 bool ProcessCopyOutputResponse(scoped_refptr<media::VideoFrame> video_frame, 95 bool ProcessCopyOutputResponse(scoped_refptr<media::VideoFrame> video_frame,
94 base::TimeTicks start_time, 96 base::TimeTicks start_time,
95 const CaptureFrameCallback& capture_frame_cb, 97 const CaptureFrameCallback& capture_frame_cb,
96 std::unique_ptr<cc::CopyOutputResult> result); 98 std::unique_ptr<cc::CopyOutputResult> result);
97 99
98 // Renders the cursor if needed and then delivers the captured frame. 100 // Renders the cursor if needed and then delivers the captured frame.
99 static void CopyOutputFinishedForVideo( 101 static void CopyOutputFinishedForVideo(
100 base::WeakPtr<AuraWindowCaptureMachine> machine, 102 base::WeakPtr<AuraWindowCaptureMachine> machine,
101 base::TimeTicks start_time, 103 base::TimeTicks start_time,
102 const CaptureFrameCallback& capture_frame_cb, 104 const CaptureFrameCallback& capture_frame_cb,
(...skipping 29 matching lines...) Expand all
132 // immediately when InternalStop() is called to ensure that no more captured 134 // immediately when InternalStop() is called to ensure that no more captured
133 // frames will be delivered to the client. 135 // frames will be delivered to the client.
134 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; 136 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_;
135 137
136 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); 138 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine);
137 }; 139 };
138 140
139 } // namespace content 141 } // namespace content
140 142
141 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 143 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/capture/aura_window_capture_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698