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 11 matching lines...) Expand all Loading... |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/sys_string_conversions.h" | 23 #include "base/sys_string_conversions.h" |
24 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
25 #include "base/version.h" | 25 #include "base/version.h" |
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/launchd_mac.h" | 29 #include "chrome/common/launchd_mac.h" |
30 #include "content/common/child_process_host.h" | 30 #include "content/common/child_process_host.h" |
31 | 31 |
| 32 using ::base::files::FilePathWatcher; |
| 33 |
32 namespace { | 34 namespace { |
33 | 35 |
34 #define kServiceProcessSessionType "Background" | 36 #define kServiceProcessSessionType "Background" |
35 | 37 |
36 CFStringRef CopyServiceProcessLaunchDName() { | 38 CFStringRef CopyServiceProcessLaunchDName() { |
37 base::mac::ScopedNSAutoreleasePool pool; | 39 base::mac::ScopedNSAutoreleasePool pool; |
38 NSBundle* bundle = base::mac::MainAppBundle(); | 40 NSBundle* bundle = base::mac::MainAppBundle(); |
39 return CFStringCreateCopy(kCFAllocatorDefault, | 41 return CFStringCreateCopy(kCFAllocatorDefault, |
40 base::mac::NSToCFCast([bundle bundleIdentifier])); | 42 base::mac::NSToCFCast([bundle bundleIdentifier])); |
41 } | 43 } |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 CFErrorRef err = NULL; | 435 CFErrorRef err = NULL; |
434 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { | 436 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { |
435 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); | 437 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); |
436 LOG(ERROR) << "RemoveJob " << err; | 438 LOG(ERROR) << "RemoveJob " << err; |
437 // Exiting with zero, so launchd doesn't restart the process. | 439 // Exiting with zero, so launchd doesn't restart the process. |
438 exit(0); | 440 exit(0); |
439 } | 441 } |
440 } | 442 } |
441 } | 443 } |
442 } | 444 } |
OLD | NEW |