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 "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 5 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "content/browser/content_browser_client.h" | 9 #include "content/browser/content_browser_client.h" |
10 #include "content/browser/renderer_host/socket_stream_host.h" | 10 #include "content/browser/renderer_host/socket_stream_host.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 DeleteSocketStreamHost(socket_id); | 65 DeleteSocketStreamHost(socket_id); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 void SocketStreamDispatcherHost::OnSentData(net::SocketStream* socket, | 69 void SocketStreamDispatcherHost::OnSentData(net::SocketStream* socket, |
70 int amount_sent) { | 70 int amount_sent) { |
71 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); | 71 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); |
72 DVLOG(1) << "SocketStreamDispatcherHost::OnSentData socket_id=" << socket_id | 72 DVLOG(1) << "SocketStreamDispatcherHost::OnSentData socket_id=" << socket_id |
73 << " amount_sent=" << amount_sent; | 73 << " amount_sent=" << amount_sent; |
74 if (socket_id == content_common::kNoSocketId) { | 74 if (socket_id == content_common::kNoSocketId) { |
75 LOG(ERROR) << "NoSocketId in OnReceivedData"; | 75 LOG(ERROR) << "NoSocketId in OnSentData"; |
76 return; | 76 return; |
77 } | 77 } |
78 if (!Send(new SocketStreamMsg_SentData(socket_id, amount_sent))) { | 78 if (!Send(new SocketStreamMsg_SentData(socket_id, amount_sent))) { |
79 LOG(ERROR) << "SocketStreamMsg_SentData failed."; | 79 LOG(ERROR) << "SocketStreamMsg_SentData failed."; |
80 DeleteSocketStreamHost(socket_id); | 80 DeleteSocketStreamHost(socket_id); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void SocketStreamDispatcherHost::OnReceivedData( | 84 void SocketStreamDispatcherHost::OnReceivedData( |
85 net::SocketStream* socket, const char* data, int len) { | 85 net::SocketStream* socket, const char* data, int len) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 hosts_.Remove(socket_id); | 165 hosts_.Remove(socket_id); |
166 if (!Send(new SocketStreamMsg_Closed(socket_id))) { | 166 if (!Send(new SocketStreamMsg_Closed(socket_id))) { |
167 LOG(ERROR) << "SocketStreamMsg_Closed failed."; | 167 LOG(ERROR) << "SocketStreamMsg_Closed failed."; |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { | 171 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { |
172 return url_request_context_selector_->GetRequestContext( | 172 return url_request_context_selector_->GetRequestContext( |
173 ResourceType::SUB_RESOURCE); | 173 ResourceType::SUB_RESOURCE); |
174 } | 174 } |
OLD | NEW |