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

Unified Diff: ios/web/public/test/http_server_util.mm

Issue 2128533002: Convert ScopedVector<T> to std::vector<std::unique_ptr<T>>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/test/http_server_inttest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/http_server_util.mm
diff --git a/ios/web/public/test/http_server_util.mm b/ios/web/public/test/http_server_util.mm
index 3f7ed405054827118a9677962447bc8716a37fdb..aff1531a480064e84d1e7a05cc585fd6f2306bb9 100644
--- a/ios/web/public/test/http_server_util.mm
+++ b/ios/web/public/test/http_server_util.mm
@@ -4,6 +4,7 @@
#include "ios/web/public/test/http_server_util.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#import "ios/web/public/test/http_server.h"
#include "ios/web/public/test/response_providers/file_based_response_provider.h"
@@ -15,11 +16,10 @@ namespace test {
void SetUpSimpleHttpServer(const std::map<GURL, std::string>& responses) {
web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
DCHECK(server.IsRunning());
- std::unique_ptr<web::ResponseProvider> provider;
- provider.reset(new HtmlResponseProvider(responses));
+ auto provider = base::MakeUnique<HtmlResponseProvider>(responses);
server.RemoveAllResponseProviders();
- server.AddResponseProvider(provider.release());
+ server.AddResponseProvider(std::move(provider));
}
void SetUpFileBasedHttpServer() {
@@ -27,12 +27,10 @@ void SetUpFileBasedHttpServer() {
DCHECK(server.IsRunning());
base::FilePath path;
PathService::Get(base::DIR_MODULE, &path);
- std::unique_ptr<web::ResponseProvider> file_provider;
- file_provider.reset(new FileBasedResponseProvider(path));
- DCHECK(file_provider);
+ auto provider = base::MakeUnique<FileBasedResponseProvider>(path);
server.RemoveAllResponseProviders();
- server.AddResponseProvider(file_provider.release());
+ server.AddResponseProvider(std::move(provider));
}
} // namespace test
« no previous file with comments | « ios/web/public/test/http_server_inttest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698