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 "content/renderer/p2p/socket_dispatcher.h" | 5 #include "content/renderer/p2p/socket_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "content/common/child_process.h" | 10 #include "content/common/child_process.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 void P2PSocketDispatcher::OnFilterRemoved() { | 79 void P2PSocketDispatcher::OnFilterRemoved() { |
80 channel_ = NULL; | 80 channel_ = NULL; |
81 } | 81 } |
82 | 82 |
83 void P2PSocketDispatcher::OnChannelClosing() { | 83 void P2PSocketDispatcher::OnChannelClosing() { |
84 channel_ = NULL; | 84 channel_ = NULL; |
85 } | 85 } |
86 | 86 |
87 base::MessageLoopProxy* P2PSocketDispatcher::message_loop() { | 87 base::MessageLoopProxy* P2PSocketDispatcher::message_loop() { |
88 return message_loop_; | 88 return message_loop_.get(); |
89 } | 89 } |
90 | 90 |
91 int P2PSocketDispatcher::RegisterClient(P2PSocketClient* client) { | 91 int P2PSocketDispatcher::RegisterClient(P2PSocketClient* client) { |
92 DCHECK(message_loop_->BelongsToCurrentThread()); | 92 DCHECK(message_loop_->BelongsToCurrentThread()); |
93 return clients_.Add(client); | 93 return clients_.Add(client); |
94 } | 94 } |
95 | 95 |
96 void P2PSocketDispatcher::UnregisterClient(int id) { | 96 void P2PSocketDispatcher::UnregisterClient(int id) { |
97 DCHECK(message_loop_->BelongsToCurrentThread()); | 97 DCHECK(message_loop_->BelongsToCurrentThread()); |
98 clients_.Remove(id); | 98 clients_.Remove(id); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // hasn't processed the close message by the time it sends the | 183 // hasn't processed the close message by the time it sends the |
184 // message to the renderer. | 184 // message to the renderer. |
185 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 185 VLOG(1) << "Received P2P message for socket that doesn't exist."; |
186 return NULL; | 186 return NULL; |
187 } | 187 } |
188 | 188 |
189 return client; | 189 return client; |
190 } | 190 } |
191 | 191 |
192 } // namespace content | 192 } // namespace content |
OLD | NEW |