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

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

Issue 2881143003: Convert //content/browser/media to be clients of WakeLock mojo service. (Closed)
Patch Set: code rebase Created 3 years, 7 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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "content/browser/media/capture/cursor_renderer_aura.h" 12 #include "content/browser/media/capture/cursor_renderer_aura.h"
13 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
13 #include "media/capture/content/screen_capture_device_core.h" 14 #include "media/capture/content/screen_capture_device_core.h"
14 #include "ui/aura/window.h" 15 #include "ui/aura/window.h"
15 #include "ui/aura/window_observer.h" 16 #include "ui/aura/window_observer.h"
16 #include "ui/base/cursor/cursors_aura.h" 17 #include "ui/base/cursor/cursors_aura.h"
17 #include "ui/compositor/compositor.h" 18 #include "ui/compositor/compositor.h"
18 #include "ui/compositor/compositor_animation_observer.h" 19 #include "ui/compositor/compositor_animation_observer.h"
19 20
20 namespace cc { 21 namespace cc {
21 class CopyOutputResult; 22 class CopyOutputResult;
22 } // namespace cc 23 } // namespace cc
23 24
24 namespace device {
25 class PowerSaveBlocker;
26 } // namespace device
27
28 namespace viz { 25 namespace viz {
29 class ReadbackYUVInterface; 26 class ReadbackYUVInterface;
30 } 27 }
31 28
32 namespace content { 29 namespace content {
33 30
34 class AuraWindowCaptureMachine 31 class AuraWindowCaptureMachine
35 : public media::VideoCaptureMachine, 32 : public media::VideoCaptureMachine,
36 public aura::WindowObserver, 33 public aura::WindowObserver,
37 public ui::CompositorAnimationObserver { 34 public ui::CompositorAnimationObserver {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 115
119 // The capture parameters for this capture. 116 // The capture parameters for this capture.
120 media::VideoCaptureParams capture_params_; 117 media::VideoCaptureParams capture_params_;
121 118
122 // YUV readback pipeline. 119 // YUV readback pipeline.
123 std::unique_ptr<viz::ReadbackYUVInterface> yuv_readback_pipeline_; 120 std::unique_ptr<viz::ReadbackYUVInterface> yuv_readback_pipeline_;
124 121
125 // Renders mouse cursor on frame. 122 // Renders mouse cursor on frame.
126 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; 123 std::unique_ptr<content::CursorRendererAura> cursor_renderer_;
127 124
128 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the 125 // TODO(jiayl): Remove wake_lock_ when there is an API to keep the
129 // screen from sleeping for the drive-by web. 126 // screen from sleeping for the drive-by web.
130 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 127 device::mojom::WakeLockServicePtr wake_lock_;
131 128
132 // False while frame capture has been suspended. All other aspects of the 129 // False while frame capture has been suspended. All other aspects of the
133 // machine are maintained. 130 // machine are maintained.
134 bool frame_capture_active_; 131 bool frame_capture_active_;
135 132
136 // WeakPtrs are used for the asynchronous capture callbacks passed to external 133 // WeakPtrs are used for the asynchronous capture callbacks passed to external
137 // modules. They are only valid on the UI thread and become invalidated 134 // modules. They are only valid on the UI thread and become invalidated
138 // immediately when InternalStop() is called to ensure that no more captured 135 // immediately when InternalStop() is called to ensure that no more captured
139 // frames will be delivered to the client. 136 // frames will be delivered to the client.
140 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; 137 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_;
141 138
142 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); 139 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine);
143 }; 140 };
144 141
145 } // namespace content 142 } // namespace content
146 143
147 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 144 #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