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

Side by Side Diff: net/http/http_response_body_drainer.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « net/dns/dns_transaction.cc ('k') | net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/http/http_response_body_drainer.h" 5 #include "net/http/http_response_body_drainer.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 12 matching lines...) Expand all
23 session_(NULL) {} 23 session_(NULL) {}
24 24
25 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {} 25 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {}
26 26
27 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) { 27 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) {
28 read_buf_ = new IOBuffer(kDrainBodyBufferSize); 28 read_buf_ = new IOBuffer(kDrainBodyBufferSize);
29 next_state_ = STATE_DRAIN_RESPONSE_BODY; 29 next_state_ = STATE_DRAIN_RESPONSE_BODY;
30 int rv = DoLoop(OK); 30 int rv = DoLoop(OK);
31 31
32 if (rv == ERR_IO_PENDING) { 32 if (rv == ERR_IO_PENDING) {
33 timer_.Start(FROM_HERE, 33 timer_.Start(base::TimeDelta::FromSeconds(kTimeoutInSeconds),
34 base::TimeDelta::FromSeconds(kTimeoutInSeconds),
35 this, 34 this,
36 &HttpResponseBodyDrainer::OnTimerFired); 35 &HttpResponseBodyDrainer::OnTimerFired);
37 session_ = session; 36 session_ = session;
38 session->AddResponseDrainer(this); 37 session->AddResponseDrainer(this);
39 return; 38 return;
40 } 39 }
41 40
42 Finish(rv); 41 Finish(rv);
43 } 42 }
44 43
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 stream_->Close(true /* no keep-alive */); 117 stream_->Close(true /* no keep-alive */);
119 } else { 118 } else {
120 DCHECK_EQ(OK, result); 119 DCHECK_EQ(OK, result);
121 stream_->Close(false /* keep-alive */); 120 stream_->Close(false /* keep-alive */);
122 } 121 }
123 122
124 delete this; 123 delete this;
125 } 124 }
126 125
127 } // namespace net 126 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_transaction.cc ('k') | net/proxy/dhcp_proxy_script_adapter_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698