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

Unified Diff: ios/web/browser_state_web_view_partition_inttest.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 | « no previous file | ios/web/public/test/http_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/browser_state_web_view_partition_inttest.mm
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm
index 34974784011a326228348586df9a906d3994720e..db2ee36b576ff9f5905129c808176a70bee83898 100644
--- a/ios/web/browser_state_web_view_partition_inttest.mm
+++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -8,6 +8,7 @@
#include <string>
#import "base/mac/scoped_nsobject.h"
+#include "base/memory/ptr_util.h"
#include "base/test/ios/wait_util.h"
#include "ios/web/public/browser_state.h"
#import "ios/web/public/test/http_server.h"
@@ -50,13 +51,16 @@ class BrowserStateWebViewPartitionTest : public web::WebIntTest {
web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
ASSERT_TRUE(server.IsRunning());
- provider_.reset(new web::StringResponseProvider("Hello World"));
- server.AddResponseProvider(provider_.get());
+ auto provider =
+ base::MakeUnique<web::StringResponseProvider>("Hello World");
+ provider_ = provider.get(); // Keep a weak copy to allow unregistration.
+ server.AddResponseProvider(std::move(provider));
}
void TearDown() override {
web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
- server.RemoveResponseProvider(provider_.release());
+ server.RemoveResponseProvider(provider_);
+ provider_ = nullptr;
web::WebIntTest::TearDown();
}
@@ -134,7 +138,7 @@ class BrowserStateWebViewPartitionTest : public web::WebIntTest {
private:
// The ResponseProvider used to load a simple web page.
- std::unique_ptr<web::ResponseProvider> provider_;
+ web::ResponseProvider* provider_;
// The OTR browser state used in tests.
web::TestBrowserState otr_browser_state_;
};
« no previous file with comments | « no previous file | ios/web/public/test/http_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698