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

Side by Side Diff: content/browser/loader/async_revalidation_driver_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/loader/async_revalidation_driver.h" 5 #include "content/browser/loader/async_revalidation_driver.h"
6 6
7 #include <string> 7 #include <string>
8 #include <type_traits> 8 #include <type_traits>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 CreateProtocolHandlerCallback BindCreateProtocolHandlerCallback() { 71 CreateProtocolHandlerCallback BindCreateProtocolHandlerCallback() {
72 static_assert(std::is_base_of<net::URLRequestJob, T>::value, 72 static_assert(std::is_base_of<net::URLRequestJob, T>::value,
73 "Template argument to BindCreateProtocolHandlerCallback() must " 73 "Template argument to BindCreateProtocolHandlerCallback() must "
74 "be a subclass of URLRequestJob."); 74 "be a subclass of URLRequestJob.");
75 75
76 class TemplatedProtocolHandler 76 class TemplatedProtocolHandler
77 : public net::URLRequestJobFactory::ProtocolHandler { 77 : public net::URLRequestJobFactory::ProtocolHandler {
78 public: 78 public:
79 static std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> 79 static std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
80 Create() { 80 Create() {
81 return base::WrapUnique(new TemplatedProtocolHandler()); 81 return base::MakeUnique<TemplatedProtocolHandler>();
82 } 82 }
83 83
84 // URLRequestJobFactory::ProtocolHandler implementation: 84 // URLRequestJobFactory::ProtocolHandler implementation:
85 net::URLRequestJob* MaybeCreateJob( 85 net::URLRequestJob* MaybeCreateJob(
86 net::URLRequest* request, 86 net::URLRequest* request,
87 net::NetworkDelegate* network_delegate) const override { 87 net::NetworkDelegate* network_delegate) const override {
88 return new T(request, network_delegate); 88 return new T(request, network_delegate);
89 } 89 }
90 }; 90 };
91 91
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 TEST_F(AsyncRevalidationDriverFromCacheTest, 392 TEST_F(AsyncRevalidationDriverFromCacheTest,
393 CacheNotReadOnSuccessfulRevalidation) { 393 CacheNotReadOnSuccessfulRevalidation) {
394 driver_->StartRequest(); 394 driver_->StartRequest();
395 base::RunLoop().RunUntilIdle(); 395 base::RunLoop().RunUntilIdle();
396 396
397 EXPECT_TRUE(async_revalidation_complete_called()); 397 EXPECT_TRUE(async_revalidation_complete_called());
398 } 398 }
399 399
400 } // namespace 400 } // namespace
401 } // namespace content 401 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_widget_host_view_guest.cc ('k') | content/browser/loader/navigation_url_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698