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/renderer_host/socket_stream_host.h" | 9 #include "content/browser/renderer_host/socket_stream_host.h" |
10 #include "content/common/socket_stream.h" | 10 #include "content/common/socket_stream.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 DeleteSocketStreamHost(socket_id); | 61 DeleteSocketStreamHost(socket_id); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 void SocketStreamDispatcherHost::OnSentData(net::SocketStream* socket, | 65 void SocketStreamDispatcherHost::OnSentData(net::SocketStream* socket, |
66 int amount_sent) { | 66 int amount_sent) { |
67 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); | 67 int socket_id = SocketStreamHost::SocketIdFromSocketStream(socket); |
68 DVLOG(1) << "SocketStreamDispatcherHost::OnSentData socket_id=" << socket_id | 68 DVLOG(1) << "SocketStreamDispatcherHost::OnSentData socket_id=" << socket_id |
69 << " amount_sent=" << amount_sent; | 69 << " amount_sent=" << amount_sent; |
70 if (socket_id == content_common::kNoSocketId) { | 70 if (socket_id == content_common::kNoSocketId) { |
71 LOG(ERROR) << "NoSocketId in OnReceivedData"; | 71 LOG(ERROR) << "NoSocketId in OnSentData"; |
Randy Smith (Not in Mondays)
2011/05/03 21:30:41
Ditto. This is a fine fix, but I don't think it b
ahendrickson
2011/05/04 15:08:25
If I don't do it in this CL, I'll forget about it.
| |
72 return; | 72 return; |
73 } | 73 } |
74 if (!Send(new SocketStreamMsg_SentData(socket_id, amount_sent))) { | 74 if (!Send(new SocketStreamMsg_SentData(socket_id, amount_sent))) { |
75 LOG(ERROR) << "SocketStreamMsg_SentData failed."; | 75 LOG(ERROR) << "SocketStreamMsg_SentData failed."; |
76 DeleteSocketStreamHost(socket_id); | 76 DeleteSocketStreamHost(socket_id); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 void SocketStreamDispatcherHost::OnReceivedData( | 80 void SocketStreamDispatcherHost::OnReceivedData( |
81 net::SocketStream* socket, const char* data, int len) { | 81 net::SocketStream* socket, const char* data, int len) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 hosts_.Remove(socket_id); | 147 hosts_.Remove(socket_id); |
148 if (!Send(new SocketStreamMsg_Closed(socket_id))) { | 148 if (!Send(new SocketStreamMsg_Closed(socket_id))) { |
149 LOG(ERROR) << "SocketStreamMsg_Closed failed."; | 149 LOG(ERROR) << "SocketStreamMsg_Closed failed."; |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { | 153 net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { |
154 return url_request_context_selector_->GetRequestContext( | 154 return url_request_context_selector_->GetRequestContext( |
155 ResourceType::SUB_RESOURCE); | 155 ResourceType::SUB_RESOURCE); |
156 } | 156 } |
OLD | NEW |