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

Side by Side Diff: content/test/test_blink_web_unit_test_support.cc

Issue 2831033002: Use unique_ptr for Platform::CreateURLLoader (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/test_blink_web_unit_test_support.h" 5 #include "content/test/test_blink_web_unit_test_support.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 blink::WebFileUtilities* TestBlinkWebUnitTestSupport::GetFileUtilities() { 181 blink::WebFileUtilities* TestBlinkWebUnitTestSupport::GetFileUtilities() {
182 return &file_utilities_; 182 return &file_utilities_;
183 } 183 }
184 184
185 blink::WebIDBFactory* TestBlinkWebUnitTestSupport::IdbFactory() { 185 blink::WebIDBFactory* TestBlinkWebUnitTestSupport::IdbFactory() {
186 NOTREACHED() << 186 NOTREACHED() <<
187 "IndexedDB cannot be tested with in-process harnesses."; 187 "IndexedDB cannot be tested with in-process harnesses.";
188 return NULL; 188 return NULL;
189 } 189 }
190 190
191 blink::WebURLLoader* TestBlinkWebUnitTestSupport::CreateURLLoader() { 191 std::unique_ptr<blink::WebURLLoader>
192 TestBlinkWebUnitTestSupport::CreateURLLoader() {
192 // This loader should be used only for process-local resources such as 193 // This loader should be used only for process-local resources such as
193 // data URLs. 194 // data URLs.
194 blink::WebURLLoader* default_loader = new WebURLLoaderImpl(nullptr, nullptr); 195 auto default_loader = base::MakeUnique<WebURLLoaderImpl>(nullptr, nullptr);
195 return url_loader_factory_->CreateURLLoader(default_loader); 196 return url_loader_factory_->CreateURLLoader(std::move(default_loader));
196 } 197 }
197 198
198 blink::WebString TestBlinkWebUnitTestSupport::UserAgent() { 199 blink::WebString TestBlinkWebUnitTestSupport::UserAgent() {
199 return blink::WebString::FromUTF8("test_runner/0.0.0.0"); 200 return blink::WebString::FromUTF8("test_runner/0.0.0.0");
200 } 201 }
201 202
202 std::unique_ptr<cc::SharedBitmap> 203 std::unique_ptr<cc::SharedBitmap>
203 TestBlinkWebUnitTestSupport::AllocateSharedBitmap(const blink::WebSize& size) { 204 TestBlinkWebUnitTestSupport::AllocateSharedBitmap(const blink::WebSize& size) {
204 return shared_bitmap_manager_ 205 return shared_bitmap_manager_
205 ->AllocateSharedBitmap(gfx::Size(size.width, size.height)); 206 ->AllocateSharedBitmap(gfx::Size(size.width, size.height));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 blink::WebRTCCertificateGenerator* 332 blink::WebRTCCertificateGenerator*
332 TestBlinkWebUnitTestSupport::CreateRTCCertificateGenerator() { 333 TestBlinkWebUnitTestSupport::CreateRTCCertificateGenerator() {
333 #if BUILDFLAG(ENABLE_WEBRTC) 334 #if BUILDFLAG(ENABLE_WEBRTC)
334 return new TestWebRTCCertificateGenerator(); 335 return new TestWebRTCCertificateGenerator();
335 #else 336 #else
336 return nullptr; 337 return nullptr;
337 #endif 338 #endif
338 } 339 }
339 340
340 } // namespace content 341 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_blink_web_unit_test_support.h ('k') | third_party/WebKit/Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698