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

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

Issue 2007123003: [Android Client] Break down multi-threaded classes by thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename JniSecretFetcher to JniPairingSecretFetcher Created 4 years, 6 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/jni_display_handler.cc ('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 #include <memory>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.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 class JniDisplayHandler;
20 class JniClient; 21 class JniClient;
21 22
22 // FrameConsumer implementation that draws onto a JNI direct byte buffer. 23 // FrameConsumer implementation that draws onto a JNI direct byte buffer.
23 class JniFrameConsumer : public protocol::FrameConsumer { 24 class JniFrameConsumer : public protocol::FrameConsumer {
24 public: 25 public:
25 // Does not take ownership of |jni_runtime|. 26 // Does not take ownership of |jni_runtime| or |display|.
26 JniFrameConsumer(ChromotingJniRuntime* jni_runtime, JniClient* client); 27 JniFrameConsumer(ChromotingJniRuntime* jni_runtime,
28 base::WeakPtr<JniDisplayHandler> display);
27 29
28 ~JniFrameConsumer() override; 30 ~JniFrameConsumer() override;
29 31
30 // FrameConsumer implementation. 32 // FrameConsumer implementation.
31 std::unique_ptr<webrtc::DesktopFrame> AllocateFrame( 33 std::unique_ptr<webrtc::DesktopFrame> AllocateFrame(
32 const webrtc::DesktopSize& size) override; 34 const webrtc::DesktopSize& size) override;
33 void DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame, 35 void DrawFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
34 const base::Closure& done) override; 36 const base::Closure& done) override;
35 PixelFormat GetPixelFormat() override; 37 PixelFormat GetPixelFormat() override;
36 38
37 private: 39 private:
38 class Renderer; 40 class Renderer;
39 41
40 void OnFrameRendered(const base::Closure& done); 42 void OnFrameRendered(const base::Closure& done);
41 43
42 // Used to obtain task runner references and make calls to Java methods. 44 // Used to obtain task runner references and make calls to Java methods.
43 ChromotingJniRuntime* jni_runtime_; 45 ChromotingJniRuntime* jni_runtime_;
44 46
45 // Renderer object used to render the frames on the display thread. 47 // Renderer object used to render the frames on the display thread.
46 std::unique_ptr<Renderer> renderer_; 48 std::unique_ptr<Renderer> renderer_;
47 49
48 base::WeakPtrFactory<JniFrameConsumer> weak_factory_; 50 base::WeakPtrFactory<JniFrameConsumer> weak_factory_;
49 51
50 DISALLOW_COPY_AND_ASSIGN(JniFrameConsumer); 52 DISALLOW_COPY_AND_ASSIGN(JniFrameConsumer);
51 }; 53 };
52 54
53 } // namespace remoting 55 } // namespace remoting
54 56
55 #endif 57 #endif
OLDNEW
« no previous file with comments | « remoting/client/jni/jni_display_handler.cc ('k') | remoting/client/jni/jni_frame_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698