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..d959dd64ccb7b32ca9fb46f50732992d269b1693 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 |
+ // used. |
+ void StartProcessStatsReport(int interval_ms); |
+ |
+ // Stops to report process statistic data to network process. |
joedow
2017/06/15 22:50:44
s/Stops to report/Stops sending
Hzj_jie
2017/06/16 00:39:28
Done.
|
+ 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_; |