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

Unified Diff: remoting/host/ipc_desktop_environment_factory.h

Issue 11778049: Making DesktopEnvironment a factory class used by ClientSession to create audio/video capturers and… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/ipc_desktop_environment_factory.h
diff --git a/remoting/host/ipc_desktop_environment_factory.h b/remoting/host/ipc_desktop_environment_factory.h
index 17ee31478fd08d333979f6f7349f923bac5447a4..80bc9447dbbe87993c4642aafd97448a1e395813 100644
--- a/remoting/host/ipc_desktop_environment_factory.h
+++ b/remoting/host/ipc_desktop_environment_factory.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "remoting/host/desktop_environment_factory.h"
#include "remoting/host/desktop_session_connector.h"
@@ -30,15 +31,13 @@ class IpcDesktopEnvironmentFactory
// Passes a reference to the IPC channel connected to the daemon process and
// relevant task runners. |daemon_channel| must outlive this object.
IpcDesktopEnvironmentFactory(
- IPC::ChannelProxy* daemon_channel,
- scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner);
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
+ IPC::ChannelProxy* daemon_channel);
virtual ~IpcDesktopEnvironmentFactory();
- virtual scoped_ptr<DesktopEnvironment> Create() OVERRIDE;
+ virtual scoped_ptr<DesktopEnvironment> Create(
+ const std::string& client_jid,
+ const base::Closure& disconnect_callback) OVERRIDE;
// DesktopSessionConnector implementation.
virtual void ConnectTerminal(
@@ -52,23 +51,20 @@ class IpcDesktopEnvironmentFactory
virtual void OnTerminalDisconnected(int terminal_id) OVERRIDE;
private:
+ // Task runner on which public methods of this class should be called.
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_;
+
// IPC channel connected to the daemon process.
IPC::ChannelProxy* daemon_channel_;
- // Task runner used to run the audio capturer.
- scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner_;
-
- // Task runner used to service calls to the DesktopSessionConnector APIs.
- scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
-
- // Task runner used to run the video capturer.
- scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_;
-
// List of DesktopEnvironment instances we've told the daemon process about.
typedef std::map<int, scoped_refptr<DesktopSessionProxy> >
ActiveConnectionsList;
ActiveConnectionsList active_connections_;
+ // Factory for weak pointers to DesktopSessionConnector interface.
+ base::WeakPtrFactory<DesktopSessionConnector> connector_factory_;
+
// Next desktop session ID. IDs are allocated sequentially starting from 0.
// This gives us more than 67 years of unique IDs assuming a new ID is
// allocated every second.

Powered by Google App Engine
This is Rietveld 408576698