| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/service_process_util_posix.h" | 5 #include "chrome/common/service_process_util_posix.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #include <launch.h> | 8 #include <launch.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/chrome_version_info.h" | 28 #include "chrome/common/chrome_version_info.h" |
| 29 #include "chrome/common/mac/launchd.h" | 29 #include "chrome/common/mac/launchd.h" |
| 30 #include "content/common/child_process_host.h" | 30 #include "content/common/child_process_host.h" |
| 31 | 31 |
| 32 using ::base::files::FilePathWatcher; | 32 using ::base::files::FilePathWatcher; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // TODO(scottbyer): Determine if we really need to go back to "Background", and | |
| 37 // subclass NSApplication to prevent -terminate from calling exit() in that | |
| 38 // case. http://crbug.com/88954 | |
| 39 #define kServiceProcessSessionType "Aqua" | 36 #define kServiceProcessSessionType "Aqua" |
| 40 | 37 |
| 41 CFStringRef CopyServiceProcessLaunchDName() { | 38 CFStringRef CopyServiceProcessLaunchDName() { |
| 42 base::mac::ScopedNSAutoreleasePool pool; | 39 base::mac::ScopedNSAutoreleasePool pool; |
| 43 NSBundle* bundle = base::mac::MainAppBundle(); | 40 NSBundle* bundle = base::mac::MainAppBundle(); |
| 44 return CFStringCreateCopy(kCFAllocatorDefault, | 41 return CFStringCreateCopy(kCFAllocatorDefault, |
| 45 base::mac::NSToCFCast([bundle bundleIdentifier])); | 42 base::mac::NSToCFCast([bundle bundleIdentifier])); |
| 46 } | 43 } |
| 47 | 44 |
| 48 NSString* GetServiceProcessLaunchDLabel() { | 45 NSString* GetServiceProcessLaunchDLabel() { |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 CFErrorRef err = NULL; | 436 CFErrorRef err = NULL; |
| 440 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { | 437 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { |
| 441 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); | 438 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); |
| 442 LOG(ERROR) << "RemoveJob " << err; | 439 LOG(ERROR) << "RemoveJob " << err; |
| 443 // Exiting with zero, so launchd doesn't restart the process. | 440 // Exiting with zero, so launchd doesn't restart the process. |
| 444 exit(0); | 441 exit(0); |
| 445 } | 442 } |
| 446 } | 443 } |
| 447 } | 444 } |
| 448 } | 445 } |
| OLD | NEW |