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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 470 |
471 bool Channel::Connect() { | 471 bool Channel::Connect() { |
472 return channel_impl_->Connect(); | 472 return channel_impl_->Connect(); |
473 } | 473 } |
474 | 474 |
475 void Channel::Close() { | 475 void Channel::Close() { |
476 if (channel_impl_) | 476 if (channel_impl_) |
477 channel_impl_->Close(); | 477 channel_impl_->Close(); |
478 } | 478 } |
479 | 479 |
480 void Channel::set_listener(Listener* listener) { | |
481 channel_impl_->set_listener(listener); | |
482 } | |
483 | |
484 base::ProcessId Channel::peer_pid() const { | 480 base::ProcessId Channel::peer_pid() const { |
485 return channel_impl_->peer_pid(); | 481 return channel_impl_->peer_pid(); |
486 } | 482 } |
487 | 483 |
488 bool Channel::Send(Message* message) { | 484 bool Channel::Send(Message* message) { |
489 return channel_impl_->Send(message); | 485 return channel_impl_->Send(message); |
490 } | 486 } |
491 | 487 |
492 // static | 488 // static |
493 bool Channel::IsNamedServerInitialized(const std::string& channel_id) { | 489 bool Channel::IsNamedServerInitialized(const std::string& channel_id) { |
(...skipping 14 matching lines...) Expand all Loading... |
508 int secret; | 504 int secret; |
509 do { // Guarantee we get a non-zero value. | 505 do { // Guarantee we get a non-zero value. |
510 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 506 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
511 } while (secret == 0); | 507 } while (secret == 0); |
512 | 508 |
513 id.append(GenerateUniqueRandomChannelID()); | 509 id.append(GenerateUniqueRandomChannelID()); |
514 return id.append(base::StringPrintf("\\%d", secret)); | 510 return id.append(base::StringPrintf("\\%d", secret)); |
515 } | 511 } |
516 | 512 |
517 } // namespace IPC | 513 } // namespace IPC |
OLD | NEW |