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

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

Issue 762723003: Prefix CommandLine usage with base namespace (Part 8: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.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.cc
diff --git a/components/dom_distiller/standalone/content_extractor.cc b/components/dom_distiller/standalone/content_extractor.cc
index 3842d088fd7a0ddc736a6fa6fdce0583c48505db..6c0e75bd5884391e189dc628cddddaf1b7a2fea8 100644
--- a/components/dom_distiller/standalone/content_extractor.cc
+++ b/components/dom_distiller/standalone/content_extractor.cc
@@ -225,7 +225,7 @@ class ContentExtractionRequest : public ViewRequestDelegate {
}
static ScopedVector<ContentExtractionRequest> CreateForCommandLine(
- const CommandLine& command_line,
+ const base::CommandLine& command_line,
UrlToDomainMap* url_to_domain_map) {
ScopedVector<ContentExtractionRequest> requests;
if (command_line.HasSwitch(kUrlSwitch)) {
@@ -304,7 +304,7 @@ class ContentExtractor : public ContentBrowserTest {
// Change behavior of the default host resolver to avoid DNS lookup errors, so
// we can make network calls.
void SetUpOnMainThread() override {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(kDisableDnsSwitch)) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableDnsSwitch)) {
EnableDNSLookupForThisTest();
}
CHECK(db_dir_.CreateUniqueTempDir());
@@ -317,7 +317,8 @@ class ContentExtractor : public ContentBrowserTest {
// Creates the DomDistillerService and creates and starts the extraction
// request.
void Start() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
UrlToDomainMap url_to_domain_map;
requests_ = ContentExtractionRequest::CreateForCommandLine(
command_line, &url_to_domain_map);
@@ -367,18 +368,19 @@ class ContentExtractor : public ContentBrowserTest {
}
void DoArticleOutput() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
for (size_t i = 0; i < requests_.size(); ++i) {
const DistilledArticleProto& article = requests_[i]->GetArticleCopy();
- if (CommandLine::ForCurrentProcess()->HasSwitch(kShouldOutputBinary)) {
+ if (command_line.HasSwitch(kShouldOutputBinary)) {
WriteProtobufWithSize(article, protobuf_output_stream_.get());
} else {
output_data_ += GetReadableArticleString(article) + "\n";
}
}
- if (CommandLine::ForCurrentProcess()->HasSwitch(kOutputFile)) {
- base::FilePath filename =
- CommandLine::ForCurrentProcess()->GetSwitchValuePath(kOutputFile);
+ if (command_line.HasSwitch(kOutputFile)) {
+ base::FilePath filename = command_line.GetSwitchValuePath(kOutputFile);
ASSERT_EQ(
(int)output_data_.size(),
base::WriteFile(filename, output_data_.c_str(), output_data_.size()));
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_params_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698