OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/system/channel.h" | 5 #include "mojo/system/channel.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 base::AutoLock locker(lock_); | 60 base::AutoLock locker(lock_); |
61 DCHECK(raw_channel_.get()); | 61 DCHECK(raw_channel_.get()); |
62 raw_channel_->Shutdown(); | 62 raw_channel_->Shutdown(); |
63 raw_channel_.reset(); | 63 raw_channel_.reset(); |
64 | 64 |
65 // This should not occur, but it probably mostly results in leaking; | 65 // This should not occur, but it probably mostly results in leaking; |
66 // (Explicitly clearing the |local_id_to_endpoint_info_map_| would likely put | 66 // (Explicitly clearing the |local_id_to_endpoint_info_map_| would likely put |
67 // things in an inconsistent state, which is worse. Note that if the map is | 67 // things in an inconsistent state, which is worse. Note that if the map is |
68 // nonempty, we probably won't be destroyed, since the endpoints have a | 68 // nonempty, we probably won't be destroyed, since the endpoints have a |
69 // reference to us.) | 69 // reference to us.) |
70 LOG_IF(ERROR, local_id_to_endpoint_info_map_.empty()) | 70 LOG_IF(ERROR, !local_id_to_endpoint_info_map_.empty()) |
71 << "Channel shutting down with endpoints still attached"; | 71 << "Channel shutting down with endpoints still attached"; |
72 // TODO(vtl): This currently blows up, but the fix will be nontrivial. | 72 // TODO(vtl): This currently blows up, but the fix will be nontrivial. |
73 // crbug.com/360081 | 73 // crbug.com/360081 |
74 //DCHECK(local_id_to_endpoint_info_map_.empty()); | 74 //DCHECK(local_id_to_endpoint_info_map_.empty()); |
75 } | 75 } |
76 | 76 |
77 MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint( | 77 MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint( |
78 scoped_refptr<MessagePipe> message_pipe, unsigned port) { | 78 scoped_refptr<MessagePipe> message_pipe, unsigned port) { |
79 DCHECK(port == 0 || port == 1); | 79 DCHECK(port == 0 || port == 1); |
80 // Note: This assertion must *not* be done under |lock_|. | 80 // Note: This assertion must *not* be done under |lock_|. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 LOG(WARNING) << error_message; | 291 LOG(WARNING) << error_message; |
292 } | 292 } |
293 | 293 |
294 void Channel::HandleLocalError(const base::StringPiece& error_message) { | 294 void Channel::HandleLocalError(const base::StringPiece& error_message) { |
295 // TODO(vtl): Is this how we really want to handle this? | 295 // TODO(vtl): Is this how we really want to handle this? |
296 LOG(WARNING) << error_message; | 296 LOG(WARNING) << error_message; |
297 } | 297 } |
298 | 298 |
299 } // namespace system | 299 } // namespace system |
300 } // namespace mojo | 300 } // namespace mojo |
OLD | NEW |