| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_posix.h" | 5 #include "ipc/ipc_channel_posix.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // this scheme. | 79 // this scheme. |
| 80 | 80 |
| 81 class PipeMap { | 81 class PipeMap { |
| 82 public: | 82 public: |
| 83 static PipeMap* GetInstance() { | 83 static PipeMap* GetInstance() { |
| 84 return Singleton<PipeMap>::get(); | 84 return Singleton<PipeMap>::get(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 ~PipeMap() { | 87 ~PipeMap() { |
| 88 // Shouldn't have left over pipes. | 88 // Shouldn't have left over pipes. |
| 89 DCHECK(map_.size() == 0); | 89 DCHECK(map_.empty()); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Lookup a given channel id. Return -1 if not found. | 92 // Lookup a given channel id. Return -1 if not found. |
| 93 int Lookup(const std::string& channel_id) { | 93 int Lookup(const std::string& channel_id) { |
| 94 base::AutoLock locked(lock_); | 94 base::AutoLock locked(lock_); |
| 95 | 95 |
| 96 ChannelToFDMap::const_iterator i = map_.find(channel_id); | 96 ChannelToFDMap::const_iterator i = map_.find(channel_id); |
| 97 if (i == map_.end()) | 97 if (i == map_.end()) |
| 98 return -1; | 98 return -1; |
| 99 return i->second; | 99 return i->second; |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1156 |
| 1157 bool Channel::HasAcceptedConnection() const { | 1157 bool Channel::HasAcceptedConnection() const { |
| 1158 return channel_impl_->HasAcceptedConnection(); | 1158 return channel_impl_->HasAcceptedConnection(); |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 void Channel::ResetToAcceptingConnectionState() { | 1161 void Channel::ResetToAcceptingConnectionState() { |
| 1162 channel_impl_->ResetToAcceptingConnectionState(); | 1162 channel_impl_->ResetToAcceptingConnectionState(); |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 } // namespace IPC | 1165 } // namespace IPC |
| OLD | NEW |