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

Side by Side Diff: remoting/host/desktop_process.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: 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
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 // This file implements the Windows service controlling Me2Me host processes 5 // This file implements the Windows service controlling Me2Me host processes
6 // running within user sessions. 6 // running within user sessions.
7 7
8 #include "remoting/host/desktop_process.h" 8 #include "remoting/host/desktop_process.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 bool DesktopProcess::OnMessageReceived(const IPC::Message& message) { 56 bool DesktopProcess::OnMessageReceived(const IPC::Message& message) {
57 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 57 DCHECK(caller_task_runner_->BelongsToCurrentThread());
58 58
59 bool handled = true; 59 bool handled = true;
60 IPC_BEGIN_MESSAGE_MAP(DesktopProcess, message) 60 IPC_BEGIN_MESSAGE_MAP(DesktopProcess, message)
61 IPC_MESSAGE_HANDLER(ChromotingDaemonDesktopMsg_Crash, OnCrash) 61 IPC_MESSAGE_HANDLER(ChromotingDaemonDesktopMsg_Crash, OnCrash)
62 IPC_MESSAGE_UNHANDLED(handled = false) 62 IPC_MESSAGE_UNHANDLED(handled = false)
63 IPC_END_MESSAGE_MAP() 63 IPC_END_MESSAGE_MAP()
64
65 CHECK(handled) << "An unexpected IPC message received: type="
Wez 2013/03/04 23:17:09 nit: "Received unexpected IPC type:"?
alexeypa (please no reviews) 2013/03/05 00:01:44 Done.
66 << message.type();
64 return handled; 67 return handled;
65 } 68 }
66 69
67 void DesktopProcess::OnChannelConnected(int32 peer_pid) { 70 void DesktopProcess::OnChannelConnected(int32 peer_pid) {
68 DCHECK(caller_task_runner_->BelongsToCurrentThread()); 71 DCHECK(caller_task_runner_->BelongsToCurrentThread());
69 72
70 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")"; 73 VLOG(1) << "IPC: desktop <- daemon (" << peer_pid << ")";
71 } 74 }
72 75
73 void DesktopProcess::OnChannelError() { 76 void DesktopProcess::OnChannelError() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 148 }
146 149
147 void DesktopProcess::OnCrash(const std::string& function_name, 150 void DesktopProcess::OnCrash(const std::string& function_name,
148 const std::string& file_name, 151 const std::string& file_name,
149 const int& line_number) { 152 const int& line_number) {
150 // The daemon requested us to crash the process. 153 // The daemon requested us to crash the process.
151 CHECK(false); 154 CHECK(false);
152 } 155 }
153 156
154 } // namespace remoting 157 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698