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

Unified Diff: remoting/host/desktop_session_agent.cc

Issue 11447021: Added support of Secure Attention Sequence in multiprocess mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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.cc
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
index bb5024d9be9d1bb8172307e9f338d7288ea36279..30164c592d377dacae124907c7b4db3d63f7d347 100644
--- a/remoting/host/desktop_session_agent.cc
+++ b/remoting/host/desktop_session_agent.cc
@@ -60,6 +60,9 @@ void DesktopSesssionClipboardStub::InjectClipboardEvent(
} // namespace
+DesktopSessionAgent::Delegate::~Delegate() {
+}
+
DesktopSessionAgent::~DesktopSessionAgent() {
DCHECK(!network_channel_);
DCHECK(!video_capturer_);
@@ -100,7 +103,7 @@ void DesktopSessionAgent::OnChannelError() {
network_channel_.reset();
// Notify the caller that the channel has been disconnected.
- disconnected_task_.Run();
+ delegate_->OnNetworkProcessDisconnected();
}
scoped_refptr<SharedBuffer> DesktopSessionAgent::CreateSharedBuffer(
@@ -188,19 +191,19 @@ void DesktopSessionAgent::InjectClipboardEvent(
new ChromotingDesktopNetworkMsg_InjectClipboardEvent(serialized_event));
}
-bool DesktopSessionAgent::Start(const base::Closure& disconnected_task,
+bool DesktopSessionAgent::Start(Delegate* delegate,
IPC::PlatformFileForTransit* desktop_pipe_out) {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
+ DCHECK(delegate_ == NULL);
- disconnected_task_ = disconnected_task;
+ delegate_ = delegate;
// Create an IPC channel to communicate with the network process.
if (!CreateChannelForNetworkProcess(desktop_pipe_out, &network_channel_))
return false;
// Create and start the event executor.
- event_executor_ = EventExecutor::Create(input_task_runner(),
- caller_task_runner());
+ event_executor_ = CreateEventExecutor();
scoped_ptr<protocol::ClipboardStub> clipboard_stub(
new DesktopSesssionClipboardStub(this));
event_executor_->Start(clipboard_stub.Pass());
@@ -214,6 +217,8 @@ bool DesktopSessionAgent::Start(const base::Closure& disconnected_task,
void DesktopSessionAgent::Stop() {
DCHECK(caller_task_runner()->BelongsToCurrentThread());
+ delegate_ = NULL;
+
// Make sure the channel is closed.
network_channel_.reset();
@@ -399,6 +404,7 @@ DesktopSessionAgent::DesktopSessionAgent(
input_task_runner_(input_task_runner),
io_task_runner_(io_task_runner),
video_capture_task_runner_(video_capture_task_runner),
+ delegate_(NULL),
next_shared_buffer_id_(1) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
}

Powered by Google App Engine
This is Rietveld 408576698