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

Side by Side Diff: net/test/spawned_test_server/spawner_communicator.cc

Issue 2082773002: Remove calls to MessageLoop::current() in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forward declaration Created 4 years, 5 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/quic/quic_connection_logger.cc ('k') | no next file » | 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/test/spawned_test_server/spawner_communicator.h" 5 #include "net/test/spawned_test_server/spawner_communicator.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 WaitForResponse(); 168 WaitForResponse();
169 } 169 }
170 170
171 void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread( 171 void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread(
172 const std::string& command, 172 const std::string& command,
173 const std::string& post_data, 173 const std::string& post_data,
174 int* result_code, 174 int* result_code,
175 std::string* data_received) { 175 std::string* data_received) {
176 base::MessageLoop* loop = io_thread_.message_loop(); 176 base::MessageLoop* loop = io_thread_.message_loop();
177 DCHECK(loop); 177 DCHECK(loop);
178 DCHECK_EQ(base::MessageLoop::current(), loop); 178 DCHECK(loop->task_runner()->BelongsToCurrentThread());
179 179
180 // Prepare the URLRequest for sending the command. 180 // Prepare the URLRequest for sending the command.
181 DCHECK(!cur_request_.get()); 181 DCHECK(!cur_request_.get());
182 context_.reset(new TestURLRequestContext); 182 context_.reset(new TestURLRequestContext);
183 cur_request_ = context_->CreateRequest( 183 cur_request_ = context_->CreateRequest(
184 GenerateSpawnerCommandURL(command, port_), DEFAULT_PRIORITY, this); 184 GenerateSpawnerCommandURL(command, port_), DEFAULT_PRIORITY, this);
185 DCHECK(cur_request_); 185 DCHECK(cur_request_);
186 int current_request_id = ++next_id_; 186 int current_request_id = ++next_id_;
187 SpawnerRequestData* data = new SpawnerRequestData(current_request_id, 187 SpawnerRequestData* data = new SpawnerRequestData(current_request_id,
188 result_code, 188 result_code,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 std::string server_return_data; 378 std::string server_return_data;
379 int result_code; 379 int result_code;
380 SendCommandAndWaitForResult("kill", "", &result_code, &server_return_data); 380 SendCommandAndWaitForResult("kill", "", &result_code, &server_return_data);
381 Shutdown(); 381 Shutdown();
382 if (OK != result_code || server_return_data != "killed") 382 if (OK != result_code || server_return_data != "killed")
383 return false; 383 return false;
384 return true; 384 return true;
385 } 385 }
386 386
387 } // namespace net 387 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698