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