| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_win.h" | 5 #include "ipc/ipc_channel_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <sddl.h> | 8 #include <sddl.h> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const std::wstring Channel::ChannelImpl::PipeName( | 170 const std::wstring Channel::ChannelImpl::PipeName( |
| 171 const std::string& channel_id) const { | 171 const std::string& channel_id) const { |
| 172 std::wostringstream ss; | 172 std::wostringstream ss; |
| 173 // XXX(darin): get application name from somewhere else | 173 // XXX(darin): get application name from somewhere else |
| 174 ss << L"\\\\.\\pipe\\chrome." << ASCIIToWide(channel_id); | 174 ss << L"\\\\.\\pipe\\chrome." << ASCIIToWide(channel_id); |
| 175 return ss.str(); | 175 return ss.str(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool Channel::ChannelImpl::CreatePipe(const IPC::ChannelHandle &channel_handle, | 178 bool Channel::ChannelImpl::CreatePipe(const IPC::ChannelHandle &channel_handle, |
| 179 Mode mode) { | 179 Mode mode) { |
| 180 DCHECK(pipe_ == INVALID_HANDLE_VALUE); | 180 DCHECK_EQ(INVALID_HANDLE_VALUE, pipe_); |
| 181 const std::wstring pipe_name = PipeName(channel_handle.name); | 181 const std::wstring pipe_name = PipeName(channel_handle.name); |
| 182 if (mode & MODE_SERVER_FLAG) { | 182 if (mode & MODE_SERVER_FLAG) { |
| 183 SECURITY_ATTRIBUTES security_attributes = {0}; | 183 SECURITY_ATTRIBUTES security_attributes = {0}; |
| 184 security_attributes.bInheritHandle = FALSE; | 184 security_attributes.bInheritHandle = FALSE; |
| 185 security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); | 185 security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); |
| 186 if (!GetLogonSessionOnlyDACL( | 186 if (!GetLogonSessionOnlyDACL( |
| 187 reinterpret_cast<SECURITY_DESCRIPTOR**>( | 187 reinterpret_cast<SECURITY_DESCRIPTOR**>( |
| 188 &security_attributes.lpSecurityDescriptor))) { | 188 &security_attributes.lpSecurityDescriptor))) { |
| 189 NOTREACHED(); | 189 NOTREACHED(); |
| 190 } | 190 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 void Channel::set_listener(Listener* listener) { | 492 void Channel::set_listener(Listener* listener) { |
| 493 channel_impl_->set_listener(listener); | 493 channel_impl_->set_listener(listener); |
| 494 } | 494 } |
| 495 | 495 |
| 496 bool Channel::Send(Message* message) { | 496 bool Channel::Send(Message* message) { |
| 497 return channel_impl_->Send(message); | 497 return channel_impl_->Send(message); |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace IPC | 500 } // namespace IPC |
| OLD | NEW |