]> khamidou — GitHub mirrors - electron.git/commitdiff
CommandLine moved to base::CommandLine
authorCheng Zhao <zcbenz@gmail.com>
Tue, 10 Mar 2015 22:27:27 +0000 (15:27 -0700)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 18 Mar 2015 01:57:37 +0000 (09:57 +0800)
atom/app/atom_main_delegate.cc
atom/browser/api/atom_api_app.cc
atom/common/crash_reporter/crash_reporter.cc
atom/common/crash_reporter/win/crash_service.cc
atom/common/crash_reporter/win/crash_service_main.cc
atom/common/node_bindings.cc
atom/renderer/atom_render_view_observer.cc

index f376df86681b494ea5922ff6dce61eef90802800..9f86bbb57f116b5128bd0aa36136bb8d1247b197 100644 (file)
@@ -59,7 +59,7 @@ void AtomMainDelegate::PreSandboxStartup() {
   if (!env->HasVar("GOOGLE_API_KEY"))
     env->SetVar("GOOGLE_API_KEY", GOOGLEAPIS_API_KEY);
 
-  CommandLine* command_line = CommandLine::ForCurrentProcess();
+  auto command_line = base::CommandLine::ForCurrentProcess();
   std::string process_type = command_line->GetSwitchValueASCII(
       switches::kProcessType);
 
index 85d95f4c2d803f747099b499dafdb8d2fa119496..37cfaf6403951887b0234855ba1d4798d5e9e85c 100644 (file)
@@ -238,11 +238,12 @@ mate::Handle<App> App::Create(v8::Isolate* isolate) {
 namespace {
 
 void AppendSwitch(const std::string& switch_string, mate::Arguments* args) {
+  auto command_line = base::CommandLine::ForCurrentProcess();
   std::string value;
   if (args->GetNext(&value))
-    CommandLine::ForCurrentProcess()->AppendSwitchASCII(switch_string, value);
+    command_line->AppendSwitchASCII(switch_string, value);
   else
-    CommandLine::ForCurrentProcess()->AppendSwitch(switch_string);
+    command_line->AppendSwitch(switch_string);
 }
 
 #if defined(OS_MACOSX)
@@ -263,13 +264,13 @@ void DockSetMenu(atom::api::Menu* menu) {
 void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
                 v8::Handle<v8::Context> context, void* priv) {
   v8::Isolate* isolate = context->GetIsolate();
-  CommandLine* command_line = CommandLine::ForCurrentProcess();
+  auto command_line = base::CommandLine::ForCurrentProcess();
 
   mate::Dictionary dict(isolate, exports);
   dict.Set("app", atom::api::App::Create(isolate));
   dict.SetMethod("appendSwitch", &AppendSwitch);
   dict.SetMethod("appendArgument",
-                 base::Bind(&CommandLine::AppendArg,
+                 base::Bind(&base::CommandLine::AppendArg,
                             base::Unretained(command_line)));
 #if defined(OS_MACOSX)
   auto browser = base::Unretained(Browser::Get());
index 45f0101924c894ec00f814d5d923d4a9194d2c94..33b8235798ad2809f31d0cf749b6f90d13e5b8a4 100644 (file)
@@ -12,8 +12,8 @@
 namespace crash_reporter {
 
 CrashReporter::CrashReporter() {
-  const CommandLine& command = *CommandLine::ForCurrentProcess();
-  is_browser_ = command.GetSwitchValueASCII(switches::kProcessType).empty();
+  auto command_line = base::CommandLine::ForCurrentProcess();
+  is_browser_ = command->GetSwitchValueASCII(switches::kProcessType).empty();
 }
 
 CrashReporter::~CrashReporter() {
index e0a552c094fa8fe63cb8bee8d9fd3bd303a87055..10e0fdfcc55584980df566fbe76c46ee96680b43 100644 (file)
@@ -205,7 +205,7 @@ bool CrashService::Initialize(const base::FilePath& operating_dir,
   // reports per day quota. Does not seem to serve any other purpose.
   base::FilePath checkpoint_path = operating_dir.Append(kCheckPointFile);
 
-  CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+  base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
 
   base::FilePath dumps_path_to_use = dumps_path;
 
index 5f21dee070b46a066dd00a2138e2e5d60bbedd04..dd2d8fbab6d3cd11ed7e3db4e0c8f778db8a202f 100644 (file)
@@ -39,8 +39,8 @@ bool GetCrashServiceDirectory(const std::wstring& application_name,
 int Main(const wchar_t* cmd) {
   // Initialize all Chromium things.
   base::AtExitManager exit_manager;
-  CommandLine::Init(0, NULL);
-  CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+  base::CommandLine::Init(0, NULL);
+  base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
 
   // Use the application's name as pipe name and output directory.
   if (!cmd_line.HasSwitch(kApplicationName)) {
index 5efdc0b00e67296611d2628a21aead242b735fcf..ce77e58cedbe014bfcfb3f37cded7946fb922d65 100644 (file)
@@ -165,7 +165,7 @@ void NodeBindings::Initialize() {
 
 node::Environment* NodeBindings::CreateEnvironment(
     v8::Handle<v8::Context> context) {
-  CommandLine* command_line = CommandLine::ForCurrentProcess();
+  auto command_line = base::CommandLine::ForCurrentProcess();
   std::vector<std::string> args =
 #if defined(OS_WIN)
       String16VectorToStringVector(command_line->argv());
index afaf20b08aef5daa1e7298cac92858e9b379b9a4..2c1166b7e24f4696cc3d6497f962ed0d07a6d215 100644 (file)
@@ -67,7 +67,7 @@ void AtomRenderViewObserver::DidCreateDocumentElement(
   document_created_ = true;
 
   // Read --zoom-factor from command line.
-  std::string zoom_factor_str = CommandLine::ForCurrentProcess()->
+  std::string zoom_factor_str = base::CommandLine::ForCurrentProcess()->
       GetSwitchValueASCII(switches::kZoomFactor);;
   if (zoom_factor_str.empty())
     return;