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

Side by Side Diff: media/blink/video_frame_compositor.cc

Issue 1958823002: Fix implicit access to raw pointer of scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Splitting out change to scoped_refptr to follow up patch. Created 4 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 | « ipc/ipc_message_attachment_set_posix_unittest.cc ('k') | media/gpu/h264_decoder.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "media/blink/video_frame_compositor.h" 5 #include "media/blink/video_frame_compositor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 bool VideoFrameCompositor::UpdateCurrentFrame(base::TimeTicks deadline_min, 100 bool VideoFrameCompositor::UpdateCurrentFrame(base::TimeTicks deadline_min,
101 base::TimeTicks deadline_max) { 101 base::TimeTicks deadline_max) {
102 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 102 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
103 return CallRender(deadline_min, deadline_max, false); 103 return CallRender(deadline_min, deadline_max, false);
104 } 104 }
105 105
106 bool VideoFrameCompositor::HasCurrentFrame() { 106 bool VideoFrameCompositor::HasCurrentFrame() {
107 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 107 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
108 return current_frame_; 108 return static_cast<bool>(current_frame_);
109 } 109 }
110 110
111 void VideoFrameCompositor::Start(RenderCallback* callback) { 111 void VideoFrameCompositor::Start(RenderCallback* callback) {
112 TRACE_EVENT0("media", "VideoFrameCompositor::Start"); 112 TRACE_EVENT0("media", "VideoFrameCompositor::Start");
113 113
114 // Called from the media thread, so acquire the callback under lock before 114 // Called from the media thread, so acquire the callback under lock before
115 // returning in case a Stop() call comes in before the PostTask is processed. 115 // returning in case a Stop() call comes in before the PostTask is processed.
116 base::AutoLock lock(callback_lock_); 116 base::AutoLock lock(callback_lock_);
117 DCHECK(!callback_); 117 DCHECK(!callback_);
118 callback_ = callback; 118 callback_ = callback;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 last_interval_ = deadline_max - deadline_min; 249 last_interval_ = deadline_max - deadline_min;
250 250
251 // Restart the background rendering timer whether we're background rendering 251 // Restart the background rendering timer whether we're background rendering
252 // or not; in either case we should wait for |kBackgroundRenderingTimeoutMs|. 252 // or not; in either case we should wait for |kBackgroundRenderingTimeoutMs|.
253 if (background_rendering_enabled_) 253 if (background_rendering_enabled_)
254 background_rendering_timer_.Reset(); 254 background_rendering_timer_.Reset();
255 return new_frame || had_new_background_frame; 255 return new_frame || had_new_background_frame;
256 } 256 }
257 257
258 } // namespace media 258 } // namespace media
OLDNEW
« no previous file with comments | « ipc/ipc_message_attachment_set_posix_unittest.cc ('k') | media/gpu/h264_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698