| 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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
| 15 #include "base/mac/foundation_util.h" | 15 #include "base/mac/foundation_util.h" |
| 16 #include "base/mac/mac_util.h" | 16 #include "base/mac/mac_util.h" |
| 17 #include "base/mac/scoped_nsautorelease_pool.h" | 17 #include "base/mac/scoped_nsautorelease_pool.h" |
| 18 #include "base/memory/scoped_nsobject.h" | 18 #include "base/memory/scoped_nsobject.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/process_util.h" | 20 #include "base/process_util.h" |
| 21 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
| 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/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 | 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 | 37 // subclass NSApplication to prevent -terminate from calling exit() in that |
| 38 // case. http://crbug.com/88954 | 38 // case. http://crbug.com/88954 |
| 39 #define kServiceProcessSessionType "Aqua" | 39 #define kServiceProcessSessionType "Aqua" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 CFErrorRef err = NULL; | 438 CFErrorRef err = NULL; |
| 439 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { | 439 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { |
| 440 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); | 440 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); |
| 441 LOG(ERROR) << "RemoveJob " << err; | 441 LOG(ERROR) << "RemoveJob " << err; |
| 442 // Exiting with zero, so launchd doesn't restart the process. | 442 // Exiting with zero, so launchd doesn't restart the process. |
| 443 exit(0); | 443 exit(0); |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 } | 447 } |
| OLD | NEW |