| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/service/service_process_control.h" | 5 #include "chrome/browser/service/service_process_control.h" |
| 6 | 6 |
| 7 #include "app/app_switches.h" |
| 7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 9 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 10 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
| 11 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 12 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 13 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/browser_thread.h" | 15 #include "chrome/browser/browser_thread.h" |
| 15 #include "chrome/browser/io_thread.h" | 16 #include "chrome/browser/io_thread.h" |
| 16 #include "chrome/browser/upgrade_detector.h" | 17 #include "chrome/browser/upgrade_detector.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 209 |
| 209 std::string logging_level = browser_command_line.GetSwitchValueASCII( | 210 std::string logging_level = browser_command_line.GetSwitchValueASCII( |
| 210 switches::kLoggingLevel); | 211 switches::kLoggingLevel); |
| 211 if (!logging_level.empty()) | 212 if (!logging_level.empty()) |
| 212 cmd_line->AppendSwitchASCII(switches::kLoggingLevel, logging_level); | 213 cmd_line->AppendSwitchASCII(switches::kLoggingLevel, logging_level); |
| 213 | 214 |
| 214 if (browser_command_line.HasSwitch(switches::kWaitForDebuggerChildren)) { | 215 if (browser_command_line.HasSwitch(switches::kWaitForDebuggerChildren)) { |
| 215 cmd_line->AppendSwitch(switches::kWaitForDebugger); | 216 cmd_line->AppendSwitch(switches::kWaitForDebugger); |
| 216 } | 217 } |
| 217 | 218 |
| 219 std::string locale = g_browser_process->GetApplicationLocale(); |
| 220 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
| 221 |
| 218 // And then start the process asynchronously. | 222 // And then start the process asynchronously. |
| 219 launcher_ = new Launcher(this, cmd_line); | 223 launcher_ = new Launcher(this, cmd_line); |
| 220 launcher_->Run( | 224 launcher_->Run( |
| 221 NewRunnableMethod(this, &ServiceProcessControl::OnProcessLaunched)); | 225 NewRunnableMethod(this, &ServiceProcessControl::OnProcessLaunched)); |
| 222 } | 226 } |
| 223 | 227 |
| 224 void ServiceProcessControl::OnProcessLaunched() { | 228 void ServiceProcessControl::OnProcessLaunched() { |
| 225 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 229 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 226 if (launcher_->launched()) { | 230 if (launcher_->launched()) { |
| 227 // After we have successfully created the service process we try to connect | 231 // After we have successfully created the service process we try to connect |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 MessageHandler* message_handler) { | 334 MessageHandler* message_handler) { |
| 331 message_handlers_.insert(message_handler); | 335 message_handlers_.insert(message_handler); |
| 332 } | 336 } |
| 333 | 337 |
| 334 void ServiceProcessControl::RemoveMessageHandler( | 338 void ServiceProcessControl::RemoveMessageHandler( |
| 335 MessageHandler* message_handler) { | 339 MessageHandler* message_handler) { |
| 336 message_handlers_.erase(message_handler); | 340 message_handlers_.erase(message_handler); |
| 337 } | 341 } |
| 338 | 342 |
| 339 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); | 343 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControl); |
| OLD | NEW |