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

Unified Diff: remoting/host/desktop_session_agent.h

Issue 2933203002: [Chromoting] Use ProcessStatsSender in DesktopSessionAgent (desktop process) (Closed)
Patch Set: Resolve review comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_param_traits.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_agent.h
diff --git a/remoting/host/desktop_session_agent.h b/remoting/host/desktop_session_agent.h
index fff1e21c8a64a30a98fbfde613834a7cfff040ed..f961cffa0c9c005f7301e3f6a3e14813859a4af9 100644
--- a/remoting/host/desktop_session_agent.h
+++ b/remoting/host/desktop_session_agent.h
@@ -16,11 +16,14 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
#include "ipc/ipc_listener.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "remoting/host/client_session_control.h"
+#include "remoting/host/current_process_stats_agent.h"
#include "remoting/host/desktop_environment_options.h"
#include "remoting/protocol/clipboard_stub.h"
+#include "remoting/protocol/process_stats_stub.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
#include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
@@ -38,6 +41,7 @@ class AutoThreadTaskRunner;
class DesktopEnvironment;
class DesktopEnvironmentFactory;
class InputInjector;
+class ProcessStatsSender;
class RemoteInputFilter;
class ScreenControls;
class ScreenResolution;
@@ -53,7 +57,8 @@ class DesktopSessionAgent
public IPC::Listener,
public webrtc::DesktopCapturer::Callback,
public webrtc::MouseCursorMonitor::Callback,
- public ClientSessionControl {
+ public ClientSessionControl,
+ public protocol::ProcessStatsStub {
public:
class Delegate {
public:
@@ -112,6 +117,10 @@ class DesktopSessionAgent
void OnLocalMouseMoved(const webrtc::DesktopVector& position) override;
void SetDisableInputs(bool disable_inputs) override;
+ // ProcessStatsStub interface.
+ void OnProcessStats(
+ const protocol::AggregatedProcessResourceUsage& usage) override;
+
// Handles StartSessionAgent request from the client.
void OnStartSessionAgent(const std::string& authenticated_jid,
const ScreenResolution& resolution,
@@ -140,6 +149,14 @@ class DesktopSessionAgent
// Posted to |audio_capture_task_runner_| to stop the audio capturer.
void StopAudioCapturer();
+ // Starts to report process statistic data to network process. If
+ // |interval| is less than or equal to 0, a default non-zero value will be
+ // used.
+ void StartProcessStatsReport(base::TimeDelta interval);
+
+ // Stops sending process statistic data to network process.
+ void StopProcessStatsReport();
+
private:
// Task runner dedicated to running methods of |audio_capturer_|.
scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner_;
@@ -191,6 +208,11 @@ class DesktopSessionAgent
// before it's received.
std::unique_ptr<webrtc::DesktopFrame> last_frame_;
+ // Reports process statistic data to network process.
+ std::unique_ptr<ProcessStatsSender> stats_sender_;
+
+ CurrentProcessStatsAgent current_process_stats_;
+
// Used to disable callbacks to |this|.
base::WeakPtrFactory<DesktopSessionAgent> weak_factory_;
« no previous file with comments | « remoting/host/chromoting_param_traits.cc ('k') | remoting/host/desktop_session_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698