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

Side by Side Diff: remoting/client/jni/jni_frame_consumer.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/client/jni/jni_frame_consumer.h" 5 #include "remoting/client/jni/jni_frame_consumer.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "remoting/base/util.h" 11 #include "remoting/base/util.h"
12 #include "remoting/client/frame_producer.h" 12 #include "remoting/client/frame_producer.h"
13 #include "remoting/client/jni/chromoting_jni_instance.h" 13 #include "remoting/client/jni/chromoting_jni_instance.h"
14 #include "remoting/client/jni/chromoting_jni_runtime.h" 14 #include "remoting/client/jni/chromoting_jni_runtime.h"
15 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 15 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
16 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" 16 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
17 #include "ui/gfx/android/java_bitmap.h" 17 #include "ui/gfx/android/java_bitmap.h"
18 18
19 namespace remoting { 19 namespace remoting {
20 20
21 JniFrameConsumer::JniFrameConsumer( 21 JniFrameConsumer::JniFrameConsumer(
22 ChromotingJniRuntime* jni_runtime, 22 ChromotingJniRuntime* jni_runtime,
23 scoped_refptr<ChromotingJniInstance> jni_instance) 23 scoped_refptr<ChromotingJniInstance> jni_instance)
24 : jni_runtime_(jni_runtime), 24 : jni_runtime_(jni_runtime),
25 jni_instance_(jni_instance), 25 jni_instance_(jni_instance),
26 frame_producer_(NULL) { 26 frame_producer_(nullptr) {
27 } 27 }
28 28
29 JniFrameConsumer::~JniFrameConsumer() { 29 JniFrameConsumer::~JniFrameConsumer() {
30 // The producer should now return any pending buffers. At this point, however, 30 // The producer should now return any pending buffers. At this point, however,
31 // ReturnBuffer() tasks scheduled by the producer will not be delivered, 31 // ReturnBuffer() tasks scheduled by the producer will not be delivered,
32 // so we free all the buffers once the producer's queue is empty. 32 // so we free all the buffers once the producer's queue is empty.
33 base::WaitableEvent done_event(true, false); 33 base::WaitableEvent done_event(true, false);
34 frame_producer_->RequestReturnBuffers( 34 frame_producer_->RequestReturnBuffers(
35 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done_event))); 35 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done_event)));
36 done_event.Wait(); 36 done_event.Wait();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) { 127 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) {
128 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end()); 128 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end());
129 129
130 buffers_.remove(buffer); 130 buffers_.remove(buffer);
131 delete buffer; 131 delete buffer;
132 } 132 }
133 133
134 } // namespace remoting 134 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.cc ('k') | remoting/client/plugin/chromoting_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698