OLD | NEW |
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 "ipc/ipc_channel_nacl.h" | 5 #include "ipc/ipc_channel_nacl.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <sys/nacl_imc_api.h> | 9 #include <sys/nacl_imc_api.h> |
10 #include <sys/nacl_syscalls.h> | 10 #include <sys/nacl_syscalls.h> |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 base::ProcessId Channel::peer_pid() const { | 376 base::ProcessId Channel::peer_pid() const { |
377 // This shouldn't actually get used in the untrusted side of the proxy, and we | 377 // This shouldn't actually get used in the untrusted side of the proxy, and we |
378 // don't have the real pid anyway. | 378 // don't have the real pid anyway. |
379 return -1; | 379 return -1; |
380 } | 380 } |
381 | 381 |
382 bool Channel::Send(Message* message) { | 382 bool Channel::Send(Message* message) { |
383 return channel_impl_->Send(message); | 383 return channel_impl_->Send(message); |
384 } | 384 } |
385 | 385 |
386 // static | |
387 std::string Channel::GenerateVerifiedChannelID(const std::string& prefix) { | |
388 // A random name is sufficient validation on posix systems, so we don't need | |
389 // an additional shared secret. | |
390 std::string id = prefix; | |
391 if (!id.empty()) | |
392 id.append("."); | |
393 | |
394 return id.append(GenerateUniqueRandomChannelID()); | |
395 } | |
396 | |
397 } // namespace IPC | 386 } // namespace IPC |
OLD | NEW |