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

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

Issue 1398973003: Don't use base::MessageLoop::{Quit,QuitClosure} in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/mock_proxy_script_fetcher.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_transaction_test_util.h" 5 #include "net/http/http_transaction_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } else { 200 } else {
201 content_.append(read_buf_->data(), result); 201 content_.append(read_buf_->data(), result);
202 Read(); 202 Read();
203 } 203 }
204 } 204 }
205 205
206 void TestTransactionConsumer::DidFinish(int result) { 206 void TestTransactionConsumer::DidFinish(int result) {
207 state_ = DONE; 207 state_ = DONE;
208 error_ = result; 208 error_ = result;
209 if (--quit_counter_ == 0) 209 if (--quit_counter_ == 0)
210 base::MessageLoop::current()->Quit(); 210 base::MessageLoop::current()->QuitWhenIdle();
211 } 211 }
212 212
213 void TestTransactionConsumer::Read() { 213 void TestTransactionConsumer::Read() {
214 state_ = READING; 214 state_ = READING;
215 read_buf_ = new IOBuffer(1024); 215 read_buf_ = new IOBuffer(1024);
216 int result = trans_->Read(read_buf_.get(), 216 int result = trans_->Read(read_buf_.get(),
217 1024, 217 1024,
218 base::Bind(&TestTransactionConsumer::OnIOComplete, 218 base::Bind(&TestTransactionConsumer::OnIOComplete,
219 base::Unretained(this))); 219 base::Unretained(this)));
220 if (result != ERR_IO_PENDING) 220 if (result != ERR_IO_PENDING)
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 content.append(buf->data(), rv); 561 content.append(buf->data(), rv);
562 else if (rv < 0) 562 else if (rv < 0)
563 return rv; 563 return rv;
564 } while (rv > 0); 564 } while (rv > 0);
565 565
566 result->swap(content); 566 result->swap(content);
567 return OK; 567 return OK;
568 } 568 }
569 569
570 } // namespace net 570 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/proxy/mock_proxy_script_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698