| 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 "base/bind.h" |
| 7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 8 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
| 9 #include "chrome/common/service_process_util_posix.h" | 10 #include "chrome/common/service_process_util_posix.h" |
| 10 #include "content/browser/browser_thread.h" | 11 #include "content/browser/browser_thread.h" |
| 11 #include "third_party/GTM/Foundation/GTMServiceManagement.h" | 12 #include "third_party/GTM/Foundation/GTMServiceManagement.h" |
| 12 | 13 |
| 13 void ServiceProcessControl::Launcher::DoRun() { | 14 void ServiceProcessControl::Launcher::DoRun() { |
| 14 base::mac::ScopedCFTypeRef<CFDictionaryRef> launchd_plist( | 15 base::mac::ScopedCFTypeRef<CFDictionaryRef> launchd_plist( |
| 15 CreateServiceProcessLaunchdPlist(cmd_line_.get(), false)); | 16 CreateServiceProcessLaunchdPlist(cmd_line_.get(), false)); |
| 16 CFErrorRef error = NULL; | 17 CFErrorRef error = NULL; |
| 17 if (!GTMSMJobSubmit(launchd_plist, &error)) { | 18 if (!GTMSMJobSubmit(launchd_plist, &error)) { |
| 18 LOG(ERROR) << error; | 19 LOG(ERROR) << error; |
| 19 CFRelease(error); | 20 CFRelease(error); |
| 20 } else { | 21 } else { |
| 21 launched_ = true; | 22 launched_ = true; |
| 22 } | 23 } |
| 23 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 24 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 24 NewRunnableMethod(this, &Launcher::Notify)); | 25 base::Bind(&Launcher::Notify, this)); |
| 25 } | 26 } |
| OLD | NEW |