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

Side by Side Diff: net/http/http_response_body_drainer_unittest.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/dns/mdns_client_unittest.cc ('k') | net/http/http_server_properties_manager_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstring> 9 #include <cstring>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::MessageLoop::current()->Run(); 49 base::MessageLoop::current()->Run();
50 waiting_for_result_ = false; 50 waiting_for_result_ = false;
51 } 51 }
52 return result_; 52 return result_;
53 } 53 }
54 54
55 void set_result(bool result) { 55 void set_result(bool result) {
56 result_ = result; 56 result_ = result;
57 have_result_ = true; 57 have_result_ = true;
58 if (waiting_for_result_) 58 if (waiting_for_result_)
59 base::MessageLoop::current()->Quit(); 59 base::MessageLoop::current()->QuitWhenIdle();
60 } 60 }
61 61
62 private: 62 private:
63 int result_; 63 int result_;
64 bool have_result_; 64 bool have_result_;
65 bool waiting_for_result_; 65 bool waiting_for_result_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(CloseResultWaiter); 67 DISALLOW_COPY_AND_ASSIGN(CloseResultWaiter);
68 }; 68 };
69 69
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 too_many_chunks += 1; // Now it's too large. 303 too_many_chunks += 1; // Now it's too large.
304 304
305 mock_stream_->set_num_chunks(too_many_chunks); 305 mock_stream_->set_num_chunks(too_many_chunks);
306 drainer_->Start(session_.get()); 306 drainer_->Start(session_.get());
307 EXPECT_TRUE(result_waiter_.WaitForResult()); 307 EXPECT_TRUE(result_waiter_.WaitForResult());
308 } 308 }
309 309
310 } // namespace 310 } // namespace
311 311
312 } // namespace net 312 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/mdns_client_unittest.cc ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698