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

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

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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 | « remoting/client/jni/chromoting_jni_runtime.h ('k') | remoting/client/jni/jni_frame_consumer.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 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 #ifndef REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_ 5 #ifndef REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_
6 #define REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_ 6 #define REMOTING_CLIENT_JNI_JNI_FRAME_CONSUMER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory>
9 10
10 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "remoting/protocol/frame_consumer.h" 14 #include "remoting/protocol/frame_consumer.h"
15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
16 16
17 namespace remoting { 17 namespace remoting {
18 18
19 class ChromotingJniRuntime; 19 class ChromotingJniRuntime;
20 20
21 // FrameConsumer implementation that draws onto a JNI direct byte buffer. 21 // FrameConsumer implementation that draws onto a JNI direct byte buffer.
22 class JniFrameConsumer : public protocol::FrameConsumer { 22 class JniFrameConsumer : public protocol::FrameConsumer {
23 public: 23 public:
24 // Does not take ownership of |jni_runtime|. 24 // Does not take ownership of |jni_runtime|.
25 explicit JniFrameConsumer(ChromotingJniRuntime* jni_runtime); 25 explicit JniFrameConsumer(ChromotingJniRuntime* jni_runtime);
26 26
27 ~JniFrameConsumer() override; 27 ~JniFrameConsumer() override;
28 28
29 // FrameConsumer implementation. 29 // FrameConsumer implementation.
30 scoped_ptr<webrtc::DesktopFrame> AllocateFrame( 30 std::unique_ptr<webrtc::DesktopFrame> AllocateFrame(
31 const webrtc::DesktopSize& size) override; 31 const webrtc::DesktopSize& size) override;
32 void DrawFrame(scoped_ptr<webrtc::DesktopFrame> frame, 32 void DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
33 const base::Closure& done) override; 33 const base::Closure& done) override;
34 PixelFormat GetPixelFormat() override; 34 PixelFormat GetPixelFormat() override;
35 35
36 private: 36 private:
37 class Renderer; 37 class Renderer;
38 38
39 void OnFrameRendered(const base::Closure& done); 39 void OnFrameRendered(const base::Closure& done);
40 40
41 // Used to obtain task runner references and make calls to Java methods. 41 // Used to obtain task runner references and make calls to Java methods.
42 ChromotingJniRuntime* jni_runtime_; 42 ChromotingJniRuntime* jni_runtime_;
43 43
44 // Renderer object used to render the frames on the display thread. 44 // Renderer object used to render the frames on the display thread.
45 scoped_ptr<Renderer> renderer_; 45 std::unique_ptr<Renderer> renderer_;
46 46
47 base::WeakPtrFactory<JniFrameConsumer> weak_factory_; 47 base::WeakPtrFactory<JniFrameConsumer> weak_factory_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(JniFrameConsumer); 49 DISALLOW_COPY_AND_ASSIGN(JniFrameConsumer);
50 }; 50 };
51 51
52 } // namespace remoting 52 } // namespace remoting
53 53
54 #endif 54 #endif
OLDNEW
« no previous file with comments | « remoting/client/jni/chromoting_jni_runtime.h ('k') | remoting/client/jni/jni_frame_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698