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

Side by Side Diff: content/child/url_response_body_consumer_unittest.cc

Issue 2254173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/child/url_response_body_consumer.h" 5 #include "content/child/url_response_body_consumer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE; 105 options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE;
106 options.element_num_bytes = 1; 106 options.element_num_bytes = 1;
107 options.capacity_num_bytes = 1024; 107 options.capacity_num_bytes = 1024;
108 return options; 108 return options;
109 } 109 }
110 110
111 // Returns the request id. 111 // Returns the request id.
112 int SetUpRequestPeer(const RequestInfo& request_info, 112 int SetUpRequestPeer(const RequestInfo& request_info,
113 TestRequestPeer::Context* context) { 113 TestRequestPeer::Context* context) {
114 return dispatcher_->StartAsync( 114 return dispatcher_->StartAsync(
115 request_info, nullptr, base::WrapUnique(new TestRequestPeer(context)), 115 request_info, nullptr, base::MakeUnique<TestRequestPeer>(context),
116 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); 116 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr);
117 } 117 }
118 118
119 void Run(TestRequestPeer::Context* context) { 119 void Run(TestRequestPeer::Context* context) {
120 base::RunLoop run_loop; 120 base::RunLoop run_loop;
121 context->run_loop_quit_closure = run_loop.QuitClosure(); 121 context->run_loop_quit_closure = run_loop.QuitClosure();
122 run_loop.Run(); 122 run_loop.Run();
123 } 123 }
124 124
125 base::MessageLoop message_loop_; 125 base::MessageLoop message_loop_;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 Run(&context); 202 Run(&context);
203 203
204 EXPECT_TRUE(context.complete); 204 EXPECT_TRUE(context.complete);
205 EXPECT_EQ(net::ERR_FAILED, context.error_code); 205 EXPECT_EQ(net::ERR_FAILED, context.error_code);
206 EXPECT_EQ("", context.data); 206 EXPECT_EQ("", context.data);
207 } 207 }
208 208
209 } // namespace 209 } // namespace
210 210
211 } // namespace content 211 } // namespace content
OLDNEW
« no previous file with comments | « content/child/url_response_body_consumer.cc ('k') | content/child/web_data_consumer_handle_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698