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 "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
10 #include "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
11 #include "content/renderer/p2p/host_address_request.h" | 11 #include "content/renderer/p2p/host_address_request.h" |
12 #include "content/renderer/p2p/network_list_observer.h" | 12 #include "content/renderer/p2p/network_list_observer.h" |
13 #include "content/renderer/p2p/socket_client_impl.h" | 13 #include "content/renderer/p2p/socket_client_impl.h" |
14 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
15 #include "ipc/ipc_sender.h" | 15 #include "ipc/ipc_sender.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 P2PSocketDispatcher::P2PSocketDispatcher( | 19 P2PSocketDispatcher::P2PSocketDispatcher( |
20 base::SingleThreadTaskRunner* ipc_task_runner) | 20 base::SingleThreadTaskRunner* ipc_task_runner) |
21 : ipc_task_runner_(ipc_task_runner), | 21 : ipc_task_runner_(ipc_task_runner), |
22 network_notifications_started_(false), | 22 network_notifications_started_(false), |
23 network_list_observers_( | 23 network_list_observers_( |
24 new ObserverListThreadSafe<NetworkListObserver>()), | 24 new base::ObserverListThreadSafe<NetworkListObserver>()), |
25 sender_(NULL) { | 25 sender_(NULL) { |
26 } | 26 } |
27 | 27 |
28 P2PSocketDispatcher::~P2PSocketDispatcher() { | 28 P2PSocketDispatcher::~P2PSocketDispatcher() { |
29 network_list_observers_->AssertEmpty(); | 29 network_list_observers_->AssertEmpty(); |
30 for (IDMap<P2PSocketClientImpl>::iterator i(&clients_); !i.IsAtEnd(); | 30 for (IDMap<P2PSocketClientImpl>::iterator i(&clients_); !i.IsAtEnd(); |
31 i.Advance()) { | 31 i.Advance()) { |
32 i.GetCurrentValue()->Detach(); | 32 i.GetCurrentValue()->Detach(); |
33 } | 33 } |
34 } | 34 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // hasn't processed the close message by the time it sends the | 187 // hasn't processed the close message by the time it sends the |
188 // message to the renderer. | 188 // message to the renderer. |
189 DVLOG(1) << "Received P2P message for socket that doesn't exist."; | 189 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
190 return NULL; | 190 return NULL; |
191 } | 191 } |
192 | 192 |
193 return client; | 193 return client; |
194 } | 194 } |
195 | 195 |
196 } // namespace content | 196 } // namespace content |
OLD | NEW |