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

Unified Diff: ios/web/public/test/http_server.h

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/browser_state_web_view_partition_inttest.mm ('k') | ios/web/public/test/http_server.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/http_server.h
diff --git a/ios/web/public/test/http_server.h b/ios/web/public/test/http_server.h
index daf359f5ff7924221c796bea77632c3ddd68e57f..aed773953e5ebba5b690a96e131d714264e9d286 100644
--- a/ios/web/public/test/http_server.h
+++ b/ios/web/public/test/http_server.h
@@ -11,7 +11,6 @@
#import "base/mac/scoped_nsobject.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_vector.h"
#include "base/synchronization/lock.h"
#include "ios/web/public/test/response_providers/response_provider.h"
@@ -30,7 +29,7 @@ class RefCountedResponseProviderWrapper :
public:
// Main constructor.
explicit RefCountedResponseProviderWrapper(
- ResponseProvider* response_provider);
+ std::unique_ptr<ResponseProvider> response_provider);
// Returns the ResponseProvider that backs this object.
ResponseProvider* GetResponseProvider() { return response_provider_.get(); }
private:
@@ -48,7 +47,7 @@ class RefCountedResponseProviderWrapper :
// thread safe.
class HttpServer {
public:
- typedef ScopedVector<ResponseProvider> ProviderList;
+ typedef std::vector<std::unique_ptr<ResponseProvider>> ProviderList;
// Returns the shared HttpServer instance. Thread safe.
static HttpServer& GetSharedInstance();
@@ -56,7 +55,7 @@ class HttpServer {
// as well. Takes ownership of the response providers. Must be called from the
// main thread.
static HttpServer& GetSharedInstanceWithResponseProviders(
- const ProviderList& response_providers);
+ ProviderList response_providers);
// A convenience method for the longer form of
// |web::test::HttpServer::GetSharedInstance().MakeUrlForHttpServer|
@@ -82,7 +81,7 @@ class HttpServer {
// ResponseProviders must be converted at runtime after the HttpServer's port
// is determined. Please use |MakeUrl| to handle converting URLs.
// Must be called from the main thread.
- void AddResponseProvider(ResponseProvider* response_provider);
+ void AddResponseProvider(std::unique_ptr<ResponseProvider> response_provider);
// Removes the |response_provider|. Must be called from the main thread.
void RemoveResponseProvider(ResponseProvider* response_provider);
// Removes all the response providers. Must be called from the main thread.
« no previous file with comments | « ios/web/browser_state_web_view_partition_inttest.mm ('k') | ios/web/public/test/http_server.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698