OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/renderer_host/socket_stream_dispatcher_host.h" | 5 #include "chrome/browser/renderer_host/socket_stream_dispatcher_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/renderer_host/socket_stream_host.h" | 8 #include "chrome/browser/renderer_host/socket_stream_host.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/common/net/socket_stream.h" | 10 #include "chrome/common/net/socket_stream.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 int socket_id = iter.GetCurrentKey(); | 22 int socket_id = iter.GetCurrentKey(); |
23 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); | 23 const SocketStreamHost* socket_stream_host = iter.GetCurrentValue(); |
24 delete socket_stream_host; | 24 delete socket_stream_host; |
25 hosts_.Remove(socket_id); | 25 hosts_.Remove(socket_id); |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 void SocketStreamDispatcherHost::Initialize( | 29 void SocketStreamDispatcherHost::Initialize( |
30 IPC::Message::Sender* sender, int process_id) { | 30 IPC::Message::Sender* sender, int process_id) { |
31 DLOG(INFO) << "Initialize: SocketStreamDispatcherHost process_id=" | 31 DLOG(INFO) << "Initialize: SocketStreamDispatcherHost process_id=" |
32 << process_id_; | 32 << process_id; |
33 DCHECK(sender); | 33 DCHECK(sender); |
34 sender_ = sender; | 34 sender_ = sender; |
35 process_id_ = process_id; | 35 process_id_ = process_id; |
36 } | 36 } |
37 | 37 |
38 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& msg, | 38 bool SocketStreamDispatcherHost::OnMessageReceived(const IPC::Message& msg, |
39 bool* msg_ok) { | 39 bool* msg_ok) { |
40 DCHECK(sender_); | 40 DCHECK(sender_); |
41 *msg_ok = true; | 41 *msg_ok = true; |
42 bool handled = true; | 42 bool handled = true; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 void SocketStreamDispatcherHost::DeleteSocketStreamHost(int socket_id) { | 153 void SocketStreamDispatcherHost::DeleteSocketStreamHost(int socket_id) { |
154 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id); | 154 SocketStreamHost* socket_stream_host = hosts_.Lookup(socket_id); |
155 DCHECK(socket_stream_host); | 155 DCHECK(socket_stream_host); |
156 delete socket_stream_host; | 156 delete socket_stream_host; |
157 hosts_.Remove(socket_id); | 157 hosts_.Remove(socket_id); |
158 if (!sender_->Send(new ViewMsg_SocketStream_Closed(socket_id))) { | 158 if (!sender_->Send(new ViewMsg_SocketStream_Closed(socket_id))) { |
159 LOG(ERROR) << "ViewMsg_SocketStream_Closed failed."; | 159 LOG(ERROR) << "ViewMsg_SocketStream_Closed failed."; |
160 } | 160 } |
161 } | 161 } |
OLD | NEW |