Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1088)

Side by Side Diff: content/browser/renderer_host/socket_stream_dispatcher_host.cc

Issue 6881106: Treat ERR_CONNECTION_CLOSED as end-of-data marker for downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698