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

Side by Side Diff: remoting/host/desktop_session_agent.cc

Issue 12390027: Crash the network or desktop process when an unknown IPC message is received. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_session_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/desktop_session_agent.h" 5 #include "remoting/host/desktop_session_agent.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ipc/ipc_channel_proxy.h" 9 #include "ipc/ipc_channel_proxy.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 IPC_MESSAGE_UNHANDLED(handled = false) 96 IPC_MESSAGE_UNHANDLED(handled = false)
97 IPC_END_MESSAGE_MAP() 97 IPC_END_MESSAGE_MAP()
98 } else { 98 } else {
99 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message) 99 IPC_BEGIN_MESSAGE_MAP(DesktopSessionAgent, message)
100 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_StartSessionAgent, 100 IPC_MESSAGE_HANDLER(ChromotingNetworkDesktopMsg_StartSessionAgent,
101 OnStartSessionAgent) 101 OnStartSessionAgent)
102 IPC_MESSAGE_UNHANDLED(handled = false) 102 IPC_MESSAGE_UNHANDLED(handled = false)
103 IPC_END_MESSAGE_MAP() 103 IPC_END_MESSAGE_MAP()
104 } 104 }
105 105
106 // Close the channel if the received message wasn't expected. 106 CHECK(handled) << "Received unexpected IPC type: " << message.type();
107 if (!handled) {
108 LOG(ERROR) << "An unexpected IPC message received: type=" << message.type();
109 OnChannelError();
110 }
111
112 return handled; 107 return handled;
113 } 108 }
114 109
115 void DesktopSessionAgent::OnChannelConnected(int32 peer_pid) { 110 void DesktopSessionAgent::OnChannelConnected(int32 peer_pid) {
116 DCHECK(caller_task_runner()->BelongsToCurrentThread()); 111 DCHECK(caller_task_runner()->BelongsToCurrentThread());
117 112
118 VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")"; 113 VLOG(1) << "IPC: desktop <- network (" << peer_pid << ")";
119 114
120 CloseDesktopPipeHandle(); 115 CloseDesktopPipeHandle();
121 } 116 }
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 base::ClosePlatformFile(desktop_pipe_.fd); 526 base::ClosePlatformFile(desktop_pipe_.fd);
532 #else // !defined(OS_POSIX) 527 #else // !defined(OS_POSIX)
533 #error Unsupported platform. 528 #error Unsupported platform.
534 #endif // !defined(OS_POSIX) 529 #endif // !defined(OS_POSIX)
535 530
536 desktop_pipe_ = IPC::InvalidPlatformFileForTransit(); 531 desktop_pipe_ = IPC::InvalidPlatformFileForTransit();
537 } 532 }
538 } 533 }
539 534
540 } // namespace remoting 535 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_process.cc ('k') | remoting/host/desktop_session_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698