| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/renderer/p2p/socket_dispatcher.h" | 5 #include "content/renderer/p2p/socket_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "content/common/p2p_messages.h" | 8 #include "content/common/p2p_messages.h" |
| 9 #include "ipc/ipc_message.h" | |
| 10 #include "ipc/ipc_message_macros.h" | |
| 11 | 9 |
| 12 P2PSocketDispatcher::P2PSocketDispatcher(RenderView* render_view) | 10 P2PSocketDispatcher::P2PSocketDispatcher(RenderView* render_view) |
| 13 : RenderViewObserver(render_view), | 11 : RenderViewObserver(render_view), |
| 14 message_loop_(base::MessageLoopProxy::CreateForCurrentThread()) { | 12 message_loop_(base::MessageLoopProxy::CreateForCurrentThread()) { |
| 15 } | 13 } |
| 16 | 14 |
| 17 P2PSocketDispatcher::~P2PSocketDispatcher() { | 15 P2PSocketDispatcher::~P2PSocketDispatcher() { |
| 18 for (IDMap<P2PSocketClient>::iterator i(&clients_); !i.IsAtEnd(); | 16 for (IDMap<P2PSocketClient>::iterator i(&clients_); !i.IsAtEnd(); |
| 19 i.Advance()) { | 17 i.Advance()) { |
| 20 i.GetCurrentValue()->Detach(); | 18 i.GetCurrentValue()->Detach(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (client == NULL) { | 76 if (client == NULL) { |
| 79 // This may happen if the socket was closed, but the browser side | 77 // This may happen if the socket was closed, but the browser side |
| 80 // hasn't processed the close message by the time it sends the | 78 // hasn't processed the close message by the time it sends the |
| 81 // message to the renderer. | 79 // message to the renderer. |
| 82 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 80 VLOG(1) << "Received P2P message for socket that doesn't exist."; |
| 83 return NULL; | 81 return NULL; |
| 84 } | 82 } |
| 85 | 83 |
| 86 return client; | 84 return client; |
| 87 } | 85 } |
| OLD | NEW |