Chromium Code Reviews| 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 dd694959a9cb9bb570278b7642ee9449f16143b3..6b9d2164e5b2c26752bb0883074ce7638022f94a 100644 |
| --- a/components/dom_distiller/standalone/content_extractor.cc |
| +++ b/components/dom_distiller/standalone/content_extractor.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "base/path_service.h" |
| #include "base/run_loop.h" |
| +#include "base/strings/string_number_conversions.h" |
| #include "components/dom_distiller/content/distiller_page_web_contents.h" |
| #include "components/dom_distiller/core/distiller.h" |
| #include "components/dom_distiller/core/dom_distiller_database.h" |
| @@ -46,6 +47,9 @@ const char* kShouldOutputBinary = "output-binary"; |
| const char* kExtractTextOnly = "extract-text-only"; |
|
nyquist
2014/05/29 17:50:41
Nit: Totally unrelated, but could you add a commen
Yaron
2014/05/29 20:16:30
Done.
|
| +// Indicates to include debug output. |
| +const char* kDebugLevel = "debug-level"; |
| + |
| scoped_ptr<DomDistillerService> CreateDomDistillerService( |
| content::BrowserContext* context, |
| const base::FilePath& db_path) { |
| @@ -69,6 +73,14 @@ scoped_ptr<DomDistillerService> CreateDomDistillerService( |
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(kExtractTextOnly)) { |
| options.set_extract_text_only(true); |
| } |
| + int debug_level = 0; |
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kDebugLevel) && |
| + base::StringToInt( |
| + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| + kDebugLevel), |
| + &debug_level)) { |
| + options.set_debug_level(debug_level); |
| + } |
| scoped_ptr<DistillerFactory> distiller_factory( |
| new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options)); |