OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 #include <launch.h> | 6 #include <launch.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
23 #include "base/strings/sys_string_conversions.h" | 23 #include "base/strings/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/mac/launchd.h" | 28 #include "chrome/common/mac/launchd.h" |
29 #include "chrome/common/service_process_util_posix.h" | 29 #include "chrome/common/service_process_util_posix.h" |
30 #include "components/version_info/version_info.h" | 30 #include "components/version_info/version_info.h" |
31 #include "ipc/unix_domain_socket_util.h" | 31 #include "mojo/edk/embedder/named_platform_handle_utils.h" |
32 | 32 |
33 @interface NSFileManager (YosemiteSDK) | 33 @interface NSFileManager (YosemiteSDK) |
34 - (BOOL)getRelationship:(NSURLRelationship*)outRelationship | 34 - (BOOL)getRelationship:(NSURLRelationship*)outRelationship |
35 ofDirectory:(NSSearchPathDirectory)directory | 35 ofDirectory:(NSSearchPathDirectory)directory |
36 inDomain:(NSSearchPathDomainMask)domainMask | 36 inDomain:(NSSearchPathDomainMask)domainMask |
37 toItemAtURL:(NSURL*)url | 37 toItemAtURL:(NSURL*)url |
38 error:(NSError**)error; | 38 error:(NSError**)error; |
39 @end | 39 @end |
40 | 40 |
41 using ::base::FilePathWatcher; | 41 using ::base::FilePathWatcher; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 private: | 89 private: |
90 base::scoped_nsobject<NSURL> executable_fsref_; | 90 base::scoped_nsobject<NSURL> executable_fsref_; |
91 }; | 91 }; |
92 | 92 |
93 base::FilePath GetServiceProcessSocketName() { | 93 base::FilePath GetServiceProcessSocketName() { |
94 base::FilePath socket_name; | 94 base::FilePath socket_name; |
95 PathService::Get(base::DIR_TEMP, &socket_name); | 95 PathService::Get(base::DIR_TEMP, &socket_name); |
96 std::string pipe_name = GetServiceProcessScopedName("srv"); | 96 std::string pipe_name = GetServiceProcessScopedName("srv"); |
97 socket_name = socket_name.Append(pipe_name); | 97 socket_name = socket_name.Append(pipe_name); |
98 CHECK_LT(socket_name.value().size(), IPC::kMaxSocketNameLength); | 98 CHECK_LT(socket_name.value().size(), mojo::edk::kMaxSocketNameLength); |
99 return socket_name; | 99 return socket_name; |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 | 103 |
104 mojo::edk::NamedPlatformHandle GetServiceProcessChannel() { | 104 mojo::edk::NamedPlatformHandle GetServiceProcessChannel() { |
105 base::FilePath socket_name = GetServiceProcessSocketName(); | 105 base::FilePath socket_name = GetServiceProcessSocketName(); |
106 VLOG(1) << "ServiceProcessChannel: " << socket_name.value(); | 106 VLOG(1) << "ServiceProcessChannel: " << socket_name.value(); |
107 return mojo::edk::NamedPlatformHandle(socket_name.value()); | 107 return mojo::edk::NamedPlatformHandle(socket_name.value()); |
108 } | 108 } |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 CFErrorRef err = NULL; | 462 CFErrorRef err = NULL; |
463 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { | 463 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { |
464 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err); | 464 base::ScopedCFTypeRef<CFErrorRef> scoped_err(err); |
465 DLOG(ERROR) << "RemoveJob " << err; | 465 DLOG(ERROR) << "RemoveJob " << err; |
466 // Exiting with zero, so launchd doesn't restart the process. | 466 // Exiting with zero, so launchd doesn't restart the process. |
467 exit(0); | 467 exit(0); |
468 } | 468 } |
469 } | 469 } |
470 } | 470 } |
471 } | 471 } |
OLD | NEW |