| 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_win.h" | 5 #include "ipc/ipc_channel_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 return; | 256 return; |
| 257 } | 257 } |
| 258 | 258 |
| 259 peer_pid_ = claimed_pid; | 259 peer_pid_ = claimed_pid; |
| 260 // Validation completed. | 260 // Validation completed. |
| 261 validate_client_ = false; | 261 validate_client_ = false; |
| 262 | 262 |
| 263 listener()->OnChannelConnected(claimed_pid); | 263 listener()->OnChannelConnected(claimed_pid); |
| 264 | 264 |
| 265 FlushPrelimQueue(); | 265 FlushPrelimQueue(); |
| 266 |
| 267 if (IsAttachmentBrokerEndpoint() && |
| 268 AttachmentBroker::GetGlobal()->IsPrivilegedBroker()) { |
| 269 AttachmentBroker::GetGlobal()->ReceivedPeerPid(claimed_pid); |
| 270 } |
| 266 } | 271 } |
| 267 | 272 |
| 268 base::ProcessId ChannelWin::GetSenderPID() { | 273 base::ProcessId ChannelWin::GetSenderPID() { |
| 269 return GetPeerPID(); | 274 return GetPeerPID(); |
| 270 } | 275 } |
| 271 | 276 |
| 272 bool ChannelWin::IsAttachmentBrokerEndpoint() { | 277 bool ChannelWin::IsAttachmentBrokerEndpoint() { |
| 273 return is_attachment_broker_endpoint(); | 278 return is_attachment_broker_endpoint(); |
| 274 } | 279 } |
| 275 | 280 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 int secret; | 606 int secret; |
| 602 do { // Guarantee we get a non-zero value. | 607 do { // Guarantee we get a non-zero value. |
| 603 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 608 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
| 604 } while (secret == 0); | 609 } while (secret == 0); |
| 605 | 610 |
| 606 id.append(GenerateUniqueRandomChannelID()); | 611 id.append(GenerateUniqueRandomChannelID()); |
| 607 return id.append(base::StringPrintf("\\%d", secret)); | 612 return id.append(base::StringPrintf("\\%d", secret)); |
| 608 } | 613 } |
| 609 | 614 |
| 610 } // namespace IPC | 615 } // namespace IPC |
| OLD | NEW |