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

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
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..5c9746e4387eb38d1ce62e1bad7ecb9b837475f7 100644
--- a/remoting/host/desktop_session_agent.h
+++ b/remoting/host/desktop_session_agent.h
@@ -19,8 +19,10 @@
#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 +40,7 @@ class AutoThreadTaskRunner;
class DesktopEnvironment;
class DesktopEnvironmentFactory;
class InputInjector;
+class ProcessStatsSender;
class RemoteInputFilter;
class ScreenControls;
class ScreenResolution;
@@ -53,7 +56,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 +116,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 +148,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_ms| is less than or equal to 0, a default value of 2000 will be
joedow 2017/06/16 22:23:16 Can you remove 2000 from here? Since the value is
Hzj_jie 2017/06/17 00:33:38 Done.
+ // used.
+ void StartProcessStatsReport(int interval_ms);
+
+ // 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 +207,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_;

Powered by Google App Engine
This is Rietveld 408576698