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

Unified Diff: net/test/spawned_test_server/spawner_communicator.cc

Issue 2842263003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: clean Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/spawner_communicator.cc
diff --git a/net/test/spawned_test_server/spawner_communicator.cc b/net/test/spawned_test_server/spawner_communicator.cc
index 0f294a3c004f6ba142615cc0112f59f10df59b4c..4b6d58efd78cb849f790ae96fba6ad5b618a664f 100644
--- a/net/test/spawned_test_server/spawner_communicator.cc
+++ b/net/test/spawned_test_server/spawner_communicator.cc
@@ -11,6 +11,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/supports_user_data.h"
@@ -186,11 +187,9 @@ void SpawnerCommunicator::SendCommandAndWaitForResultOnIOThread(
GenerateSpawnerCommandURL(command, port_), DEFAULT_PRIORITY, this);
DCHECK(cur_request_);
int current_request_id = ++next_id_;
- SpawnerRequestData* data = new SpawnerRequestData(current_request_id,
- result_code,
- data_received);
- DCHECK(data);
- cur_request_->SetUserData(this, data);
+ cur_request_->SetUserData(
+ this, base::MakeUnique<SpawnerRequestData>(current_request_id,
+ result_code, data_received));
if (post_data.empty()) {
cur_request_->set_method("GET");
« no previous file with comments | « no previous file | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698