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 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 FlushPrelimQueue(); | 241 FlushPrelimQueue(); |
242 | 242 |
243 listener()->OnChannelConnected(claimed_pid); | 243 listener()->OnChannelConnected(claimed_pid); |
244 } | 244 } |
245 | 245 |
246 base::ProcessId ChannelWin::GetSenderPID() { | 246 base::ProcessId ChannelWin::GetSenderPID() { |
247 return GetPeerPID(); | 247 return GetPeerPID(); |
248 } | 248 } |
249 | 249 |
| 250 bool ChannelWin::IsAttachmentBrokerEndpoint() { |
| 251 return is_attachment_broker_endpoint(); |
| 252 } |
| 253 |
250 bool ChannelWin::DidEmptyInputBuffers() { | 254 bool ChannelWin::DidEmptyInputBuffers() { |
251 // We don't need to do anything here. | 255 // We don't need to do anything here. |
252 return true; | 256 return true; |
253 } | 257 } |
254 | 258 |
255 // static | 259 // static |
256 const base::string16 ChannelWin::PipeName( | 260 const base::string16 ChannelWin::PipeName( |
257 const std::string& channel_id, int32* secret) { | 261 const std::string& channel_id, int32* secret) { |
258 std::string name("\\\\.\\pipe\\chrome."); | 262 std::string name("\\\\.\\pipe\\chrome."); |
259 | 263 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 int secret; | 572 int secret; |
569 do { // Guarantee we get a non-zero value. | 573 do { // Guarantee we get a non-zero value. |
570 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 574 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
571 } while (secret == 0); | 575 } while (secret == 0); |
572 | 576 |
573 id.append(GenerateUniqueRandomChannelID()); | 577 id.append(GenerateUniqueRandomChannelID()); |
574 return id.append(base::StringPrintf("\\%d", secret)); | 578 return id.append(base::StringPrintf("\\%d", secret)); |
575 } | 579 } |
576 | 580 |
577 } // namespace IPC | 581 } // namespace IPC |
OLD | NEW |