| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 listener()->OnChannelError(); | 568 listener()->OnChannelError(); |
| 569 } | 569 } |
| 570 } | 570 } |
| 571 | 571 |
| 572 //------------------------------------------------------------------------------ | 572 //------------------------------------------------------------------------------ |
| 573 // Channel's methods | 573 // Channel's methods |
| 574 | 574 |
| 575 // static | 575 // static |
| 576 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, | 576 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, |
| 577 Mode mode, | 577 Mode mode, |
| 578 Listener* listener, | 578 Listener* listener) { |
| 579 AttachmentBroker* broker) { | |
| 580 return scoped_ptr<Channel>( | 579 return scoped_ptr<Channel>( |
| 581 new ChannelWin(channel_handle, mode, listener)); | 580 new ChannelWin(channel_handle, mode, listener)); |
| 582 } | 581 } |
| 583 | 582 |
| 584 // static | 583 // static |
| 585 bool Channel::IsNamedServerInitialized(const std::string& channel_id) { | 584 bool Channel::IsNamedServerInitialized(const std::string& channel_id) { |
| 586 return ChannelWin::IsNamedServerInitialized(channel_id); | 585 return ChannelWin::IsNamedServerInitialized(channel_id); |
| 587 } | 586 } |
| 588 | 587 |
| 589 // static | 588 // static |
| (...skipping 10 matching lines...) Expand all Loading... |
| 600 int secret; | 599 int secret; |
| 601 do { // Guarantee we get a non-zero value. | 600 do { // Guarantee we get a non-zero value. |
| 602 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 601 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
| 603 } while (secret == 0); | 602 } while (secret == 0); |
| 604 | 603 |
| 605 id.append(GenerateUniqueRandomChannelID()); | 604 id.append(GenerateUniqueRandomChannelID()); |
| 606 return id.append(base::StringPrintf("\\%d", secret)); | 605 return id.append(base::StringPrintf("\\%d", secret)); |
| 607 } | 606 } |
| 608 | 607 |
| 609 } // namespace IPC | 608 } // namespace IPC |
| OLD | NEW |