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

Unified Diff: components/dom_distiller/standalone/content_extractor_browsertest.cc

Issue 2712413002: Remove ScopedVector in //components/dom_distiller/ (Closed)
Patch Set: Remove ScopedVector in //components/dom_distiller/ Created 3 years, 10 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 | « components/dom_distiller/core/dom_distiller_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/standalone/content_extractor_browsertest.cc
diff --git a/components/dom_distiller/standalone/content_extractor_browsertest.cc b/components/dom_distiller/standalone/content_extractor_browsertest.cc
index 459c3d341b40c29dc6bd6565586905417f82cccb..dd34d1ea3d7d7dbace3ae5e3e5afb95bbe99965f 100644
--- a/components/dom_distiller/standalone/content_extractor_browsertest.cc
+++ b/components/dom_distiller/standalone/content_extractor_browsertest.cc
@@ -10,6 +10,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/id_map.h"
#include "base/location.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
@@ -248,16 +249,16 @@ class ContentExtractionRequest : public ViewRequestDelegate {
return *article_proto_;
}
- static ScopedVector<ContentExtractionRequest> CreateForCommandLine(
- const base::CommandLine& command_line,
- FileToUrlMap* file_to_url_map) {
- ScopedVector<ContentExtractionRequest> requests;
+ static std::vector<std::unique_ptr<ContentExtractionRequest>>
+ CreateForCommandLine(const base::CommandLine& command_line,
+ FileToUrlMap* file_to_url_map) {
+ std::vector<std::unique_ptr<ContentExtractionRequest>> requests;
if (command_line.HasSwitch(kUrlSwitch)) {
GURL url;
std::string url_string = command_line.GetSwitchValueASCII(kUrlSwitch);
url = GURL(url_string);
if (url.is_valid()) {
- requests.push_back(new ContentExtractionRequest(url));
+ requests.push_back(base::WrapUnique(new ContentExtractionRequest(url)));
ke.he 2017/03/01 02:58:27 we use "base::WrapUnique" instead of "base::MakeUn
if (command_line.HasSwitch(kOriginalUrl)) {
(*file_to_url_map)[url.spec()] =
command_line.GetSwitchValueASCII(kOriginalUrl);
@@ -283,7 +284,8 @@ class ContentExtractionRequest : public ViewRequestDelegate {
for (size_t i = 0; i < urls.size(); ++i) {
GURL url(urls[i]);
if (url.is_valid()) {
- requests.push_back(new ContentExtractionRequest(url));
+ requests.push_back(
+ base::WrapUnique(new ContentExtractionRequest(url)));
// Only regard non-empty original urls.
if (!original_urls.empty() && !original_urls[i].empty()) {
(*file_to_url_map)[url.spec()] = original_urls[i];
@@ -431,7 +433,7 @@ class ContentExtractor : public ContentBrowserTest {
std::unique_ptr<net::ScopedDefaultHostResolverProc>
mock_host_resolver_override_;
std::unique_ptr<DomDistillerService> service_;
- ScopedVector<ContentExtractionRequest> requests_;
+ std::vector<std::unique_ptr<ContentExtractionRequest>> requests_;
std::string output_data_;
std::unique_ptr<google::protobuf::io::StringOutputStream>
« no previous file with comments | « components/dom_distiller/core/dom_distiller_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698