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" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 IPC_MESSAGE_HANDLER(P2PMsg_OnSocketCreated, OnSocketCreated) | 64 IPC_MESSAGE_HANDLER(P2PMsg_OnSocketCreated, OnSocketCreated) |
65 IPC_MESSAGE_HANDLER(P2PMsg_OnIncomingTcpConnection, OnIncomingTcpConnection) | 65 IPC_MESSAGE_HANDLER(P2PMsg_OnIncomingTcpConnection, OnIncomingTcpConnection) |
66 IPC_MESSAGE_HANDLER(P2PMsg_OnSendComplete, OnSendComplete) | 66 IPC_MESSAGE_HANDLER(P2PMsg_OnSendComplete, OnSendComplete) |
67 IPC_MESSAGE_HANDLER(P2PMsg_OnError, OnError) | 67 IPC_MESSAGE_HANDLER(P2PMsg_OnError, OnError) |
68 IPC_MESSAGE_HANDLER(P2PMsg_OnDataReceived, OnDataReceived) | 68 IPC_MESSAGE_HANDLER(P2PMsg_OnDataReceived, OnDataReceived) |
69 IPC_MESSAGE_UNHANDLED(handled = false) | 69 IPC_MESSAGE_UNHANDLED(handled = false) |
70 IPC_END_MESSAGE_MAP() | 70 IPC_END_MESSAGE_MAP() |
71 return handled; | 71 return handled; |
72 } | 72 } |
73 | 73 |
74 void P2PSocketDispatcher::OnFilterAdded(IPC::Sender* sender) { | 74 void P2PSocketDispatcher::OnFilterAdded(IPC::Channel* channel) { |
75 DVLOG(1) << "P2PSocketDispatcher::OnFilterAdded()"; | 75 DVLOG(1) << "P2PSocketDispatcher::OnFilterAdded()"; |
76 sender_ = sender; | 76 sender_ = channel; |
77 } | 77 } |
78 | 78 |
79 void P2PSocketDispatcher::OnFilterRemoved() { | 79 void P2PSocketDispatcher::OnFilterRemoved() { |
80 sender_ = NULL; | 80 sender_ = NULL; |
81 } | 81 } |
82 | 82 |
83 void P2PSocketDispatcher::OnChannelConnected(int32_t peer_id) { | 83 void P2PSocketDispatcher::OnChannelConnected(int32_t peer_id) { |
84 connected_ = true; | 84 connected_ = true; |
85 } | 85 } |
86 | 86 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // hasn't processed the close message by the time it sends the | 195 // hasn't processed the close message by the time it sends the |
196 // message to the renderer. | 196 // message to the renderer. |
197 DVLOG(1) << "Received P2P message for socket that doesn't exist."; | 197 DVLOG(1) << "Received P2P message for socket that doesn't exist."; |
198 return NULL; | 198 return NULL; |
199 } | 199 } |
200 | 200 |
201 return client; | 201 return client; |
202 } | 202 } |
203 | 203 |
204 } // namespace content | 204 } // namespace content |
OLD | NEW |