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

Side by Side Diff: remoting/client/chromoting_client_runtime.h

Issue 2753963002: Refactoring and rewriting the chromoting jni instance to be chromoting session. (Closed)
Patch Set: Pointer not obj. Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CHROMOTING_CLIENT_RUNTIME_H_ 5 #ifndef REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
6 #define REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ 6 #define REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 scoped_refptr<AutoThreadTaskRunner> file_task_runner() { 65 scoped_refptr<AutoThreadTaskRunner> file_task_runner() {
66 return file_task_runner_; 66 return file_task_runner_;
67 } 67 }
68 68
69 scoped_refptr<net::URLRequestContextGetter> url_requester() { 69 scoped_refptr<net::URLRequestContextGetter> url_requester() {
70 return url_requester_; 70 return url_requester_;
71 } 71 }
72 72
73 // Must call and use log_writter on the network thread. 73 // Must call and use log_writer on the network thread.
74 ChromotingEventLogWriter* log_writer(); 74 ChromotingEventLogWriter* log_writer();
75 75
76 private: 76 private:
77 ChromotingClientRuntime(); 77 ChromotingClientRuntime();
78 virtual ~ChromotingClientRuntime(); 78 virtual ~ChromotingClientRuntime();
79 79
80 void CreateLogWriter(); 80 void CreateLogWriter();
81 void RequestAuthTokenForLogger(); 81 void RequestAuthTokenForLogger();
82 82
83 // Chromium code's connection to the app message loop. Once created the 83 // Chromium code's connection to the app message loop. Once created the
84 // MessageLoop will live for the life of the program. 84 // MessageLoop will live for the life of the program.
85 std::unique_ptr<base::MessageLoopForUI> ui_loop_; 85 std::unique_ptr<base::MessageLoopForUI> ui_loop_;
86 86
87 // References to native threads. 87 // References to native threads.
88 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; 88 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_;
89 89
90 // TODO(nicholss): Auththreads will be leaked because they depend on the main
Lambros 2017/03/24 00:07:14 s/Auththreads/AutoThreads ?
nicholss 2017/03/29 20:32:35 Done.
91 // thread. We should update this class to use regular threads like the client
92 // plugin does.
93 // Longer term we should migrate most of these to background tasks execpt the
Lambros 2017/03/24 00:07:14 except
nicholss 2017/03/29 20:32:35 Done.
94 // network thread to TaskSchedular, removing the need for threads.
Lambros 2017/03/24 00:07:14 TaskScheduler
nicholss 2017/03/29 20:32:35 Done. This was copied from a comment given to me v
95
90 scoped_refptr<AutoThreadTaskRunner> display_task_runner_; 96 scoped_refptr<AutoThreadTaskRunner> display_task_runner_;
91 scoped_refptr<AutoThreadTaskRunner> network_task_runner_; 97 scoped_refptr<AutoThreadTaskRunner> network_task_runner_;
92 scoped_refptr<AutoThreadTaskRunner> file_task_runner_; 98 scoped_refptr<AutoThreadTaskRunner> file_task_runner_;
93 99
94 scoped_refptr<net::URLRequestContextGetter> url_requester_; 100 scoped_refptr<net::URLRequestContextGetter> url_requester_;
95 101
96 // For logging session stage changes and stats. 102 // For logging session stage changes and stats.
97 std::unique_ptr<TelemetryLogWriter> log_writer_; 103 std::unique_ptr<TelemetryLogWriter> log_writer_;
98 104
99 ChromotingClientRuntime::Delegate* delegate_; 105 ChromotingClientRuntime::Delegate* delegate_;
100 106
101 friend struct base::DefaultSingletonTraits<ChromotingClientRuntime>; 107 friend struct base::DefaultSingletonTraits<ChromotingClientRuntime>;
102 108
103 DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime); 109 DISALLOW_COPY_AND_ASSIGN(ChromotingClientRuntime);
104 }; 110 };
105 111
106 } // namespace remoting 112 } // namespace remoting
107 113
108 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_ 114 #endif // REMOTING_CLIENT_CHROMOTING_CLIENT_RUNTIME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698