diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/mac/cfbundle_blocker.mm | 4 | ||||
-rw-r--r-- | chrome/common/mac/mock_launchd.cc | 38 | ||||
-rw-r--r-- | chrome/common/multi_process_lock_mac.cc | 4 | ||||
-rw-r--r-- | chrome/common/service_process_util_mac.mm | 22 | ||||
-rw-r--r-- | chrome/common/service_process_util_posix.h | 2 |
5 files changed, 30 insertions, 40 deletions
diff --git a/chrome/common/mac/cfbundle_blocker.mm b/chrome/common/mac/cfbundle_blocker.mm index a6cb6fe..e845283 100644 --- a/chrome/common/mac/cfbundle_blocker.mm +++ b/chrome/common/mac/cfbundle_blocker.mm @@ -156,7 +156,7 @@ Boolean ChromeCFBundleLoadExecutableAndReturnError(CFBundleRef bundle, DCHECK(g_original_underscore_cfbundle_load_executable_and_return_error); - base::mac::ScopedCFTypeRef<CFURLRef> url_cf(CFBundleCopyBundleURL(bundle)); + base::ScopedCFTypeRef<CFURLRef> url_cf(CFBundleCopyBundleURL(bundle)); scoped_nsobject<NSString> path(base::mac::CFToNSCast( CFURLCopyFileSystemPath(url_cf, kCFURLPOSIXPathStyle))); @@ -185,7 +185,7 @@ Boolean ChromeCFBundleLoadExecutableAndReturnError(CFBundleRef bundle, << [path fileSystemRepresentation]; if (error) { - base::mac::ScopedCFTypeRef<CFStringRef> app_bundle_id( + base::ScopedCFTypeRef<CFStringRef> app_bundle_id( base::SysUTF8ToCFStringRef(base::mac::BaseBundleID())); // 0xb10c10ad = "block load" diff --git a/chrome/common/mac/mock_launchd.cc b/chrome/common/mac/mock_launchd.cc index bc08bf8..6a39540 100644 --- a/chrome/common/mac/mock_launchd.cc +++ b/chrome/common/mac/mock_launchd.cc @@ -83,12 +83,12 @@ bool MockLaunchd::MakeABundle(const base::FilePath& dst, } const UInt8* bundle_root_path = reinterpret_cast<const UInt8*>(bundle_root->value().c_str()); - base::mac::ScopedCFTypeRef<CFURLRef> url( + base::ScopedCFTypeRef<CFURLRef> url( CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, bundle_root_path, bundle_root->value().length(), true)); - base::mac::ScopedCFTypeRef<CFBundleRef> bundle( + base::ScopedCFTypeRef<CFBundleRef> bundle( CFBundleCreate(kCFAllocatorDefault, url)); return bundle.get(); } @@ -126,9 +126,8 @@ CFDictionaryRef MockLaunchd::CopyExports() { CFStringRef env_var = base::mac::NSToCFCast(GetServiceProcessLaunchDSocketEnvVar()); - base::mac::ScopedCFTypeRef<CFStringRef> socket_path( - CFStringCreateWithCString(kCFAllocatorDefault, pipe_name_.c_str(), - kCFStringEncodingUTF8)); + base::ScopedCFTypeRef<CFStringRef> socket_path(CFStringCreateWithCString( + kCFAllocatorDefault, pipe_name_.c_str(), kCFStringEncodingUTF8)); const void *keys[] = { env_var }; const void *values[] = { socket_path }; COMPILE_ASSERT(arraysize(keys) == arraysize(values), array_sizes_must_match); @@ -151,10 +150,10 @@ CFDictionaryRef MockLaunchd::CopyJobDictionary(CFStringRef label) { CFStringRef program = CFSTR(LAUNCH_JOBKEY_PROGRAM); CFStringRef program_pid = CFSTR(LAUNCH_JOBKEY_PID); const void *keys[] = { program, program_pid }; - base::mac::ScopedCFTypeRef<CFStringRef> path( + base::ScopedCFTypeRef<CFStringRef> path( base::SysUTF8ToCFStringRef(file_.value())); int process_id = base::GetCurrentProcId(); - base::mac::ScopedCFTypeRef<CFNumberRef> pid( + base::ScopedCFTypeRef<CFNumberRef> pid( CFNumberCreate(NULL, kCFNumberIntType, &process_id)); const void *values[] = { path, pid }; COMPILE_ASSERT(arraysize(keys) == arraysize(values), array_sizes_must_match); @@ -170,14 +169,11 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) { checkin_called_ = true; CFStringRef program = CFSTR(LAUNCH_JOBKEY_PROGRAM); CFStringRef program_args = CFSTR(LAUNCH_JOBKEY_PROGRAMARGUMENTS); - base::mac::ScopedCFTypeRef<CFStringRef> path( + base::ScopedCFTypeRef<CFStringRef> path( base::SysUTF8ToCFStringRef(file_.value())); const void *array_values[] = { path.get() }; - base::mac::ScopedCFTypeRef<CFArrayRef> args( - CFArrayCreate(kCFAllocatorDefault, - array_values, - 1, - &kCFTypeArrayCallBacks)); + base::ScopedCFTypeRef<CFArrayRef> args(CFArrayCreate( + kCFAllocatorDefault, array_values, 1, &kCFTypeArrayCallBacks)); if (!create_socket_) { const void *keys[] = { program, program_args }; @@ -210,7 +206,7 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) { signature.protocol = 0; size_t unix_addr_len = offsetof(struct sockaddr_un, sun_path) + path_len + 1; - base::mac::ScopedCFTypeRef<CFDataRef> address( + base::ScopedCFTypeRef<CFDataRef> address( CFDataCreate(NULL, reinterpret_cast<UInt8*>(&unix_addr), unix_addr_len)); signature.address = address; @@ -227,20 +223,17 @@ CFDictionaryRef MockLaunchd::CopyDictionaryByCheckingIn(CFErrorRef* error) { return NULL; } - base::mac::ScopedCFTypeRef<CFNumberRef> socket_fd( + base::ScopedCFTypeRef<CFNumberRef> socket_fd( CFNumberCreate(NULL, kCFNumberIntType, &local_pipe)); const void *socket_array_values[] = { socket_fd }; - base::mac::ScopedCFTypeRef<CFArrayRef> sockets( - CFArrayCreate(kCFAllocatorDefault, - socket_array_values, - 1, - &kCFTypeArrayCallBacks)); + base::ScopedCFTypeRef<CFArrayRef> sockets(CFArrayCreate( + kCFAllocatorDefault, socket_array_values, 1, &kCFTypeArrayCallBacks)); CFStringRef socket_dict_key = CFSTR("ServiceProcessSocket"); const void *socket_keys[] = { socket_dict_key }; const void *socket_values[] = { sockets }; COMPILE_ASSERT(arraysize(socket_keys) == arraysize(socket_values), socket_array_sizes_must_match); - base::mac::ScopedCFTypeRef<CFDictionaryRef> socket_dict( + base::ScopedCFTypeRef<CFDictionaryRef> socket_dict( CFDictionaryCreate(kCFAllocatorDefault, socket_keys, socket_values, @@ -277,8 +270,7 @@ CFMutableDictionaryRef MockLaunchd::CreatePlistFromFile( Domain domain, Type type, CFStringRef name) { - base::mac::ScopedCFTypeRef<CFDictionaryRef> dict( - CopyDictionaryByCheckingIn(NULL)); + base::ScopedCFTypeRef<CFDictionaryRef> dict(CopyDictionaryByCheckingIn(NULL)); return CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, dict); } diff --git a/chrome/common/multi_process_lock_mac.cc b/chrome/common/multi_process_lock_mac.cc index 35fc576..176ae4c 100644 --- a/chrome/common/multi_process_lock_mac.cc +++ b/chrome/common/multi_process_lock_mac.cc @@ -33,7 +33,7 @@ class MultiProcessLockMac : public MultiProcessLock { } CFStringRef cf_name(base::SysUTF8ToCFStringRef(name_)); - base::mac::ScopedCFTypeRef<CFStringRef> scoped_cf_name(cf_name); + base::ScopedCFTypeRef<CFStringRef> scoped_cf_name(cf_name); port_.reset(CFMessagePortCreateLocal(NULL, cf_name, NULL, NULL, NULL)); return port_ != NULL; } @@ -48,7 +48,7 @@ class MultiProcessLockMac : public MultiProcessLock { private: std::string name_; - base::mac::ScopedCFTypeRef<CFMessagePortRef> port_; + base::ScopedCFTypeRef<CFMessagePortRef> port_; DISALLOW_COPY_AND_ASSIGN(MultiProcessLockMac); }; diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm index 4848b80..03a6124 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -67,7 +67,7 @@ bool GetParentFSRef(const FSRef& child, FSRef* parent) { bool RemoveFromLaunchd() { // We're killing a file. base::ThreadRestrictions::AssertIOAllowed(); - base::mac::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); + base::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); return Launchd::GetInstance()->DeletePlist(Launchd::User, Launchd::Agent, name); @@ -295,8 +295,8 @@ bool ServiceProcessState::AddToAutoRun() { // We're creating directories and writing a file. base::ThreadRestrictions::AssertIOAllowed(); DCHECK(autorun_command_line_.get()); - base::mac::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); - base::mac::ScopedCFTypeRef<CFDictionaryRef> plist( + base::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); + base::ScopedCFTypeRef<CFDictionaryRef> plist( CreateServiceProcessLaunchdPlist(autorun_command_line_.get(), true)); return Launchd::GetInstance()->WritePlistToFile(Launchd::User, Launchd::Agent, @@ -358,10 +358,10 @@ void ExecFilePathWatcherCallback::NotifyPathChanged(const base::FilePath& path, if (GetParentFSRef(macos_fsref, &contents_fsref)) { FSRef bundle_fsref; if (GetParentFSRef(contents_fsref, &bundle_fsref)) { - base::mac::ScopedCFTypeRef<CFURLRef> bundle_url( + base::ScopedCFTypeRef<CFURLRef> bundle_url( CFURLCreateFromFSRef(kCFAllocatorDefault, &bundle_fsref)); if (bundle_url.get()) { - base::mac::ScopedCFTypeRef<CFBundleRef> bundle( + base::ScopedCFTypeRef<CFBundleRef> bundle( CFBundleCreate(kCFAllocatorDefault, bundle_url)); // Check to see if the bundle still has a minimal structure. good_bundle = CFBundleGetIdentifier(bundle) != NULL; @@ -394,13 +394,11 @@ void ExecFilePathWatcherCallback::NotifyPathChanged(const base::FilePath& path, } if (needs_shutdown || needs_restart) { // First deal with the plist. - base::mac::ScopedCFTypeRef<CFStringRef> name( - CopyServiceProcessLaunchDName()); + base::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); if (needs_restart) { - base::mac::ScopedCFTypeRef<CFMutableDictionaryRef> plist( - Launchd::GetInstance()->CreatePlistFromFile(Launchd::User, - Launchd::Agent, - name)); + base::ScopedCFTypeRef<CFMutableDictionaryRef> plist( + Launchd::GetInstance()->CreatePlistFromFile( + Launchd::User, Launchd::Agent, name)); if (plist.get()) { NSMutableDictionary* ns_plist = base::mac::CFToNSCast(plist); std::string new_path = base::mac::PathFromFSRef(executable_fsref_); @@ -445,7 +443,7 @@ void ExecFilePathWatcherCallback::NotifyPathChanged(const base::FilePath& path, base::mac::NSToCFCast(GetServiceProcessLaunchDLabel()); CFErrorRef err = NULL; if (!Launchd::GetInstance()->RemoveJob(label, &err)) { - base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); + base::ScopedCFTypeRef<CFErrorRef> scoped_err(err); DLOG(ERROR) << "RemoveJob " << err; // Exiting with zero, so launchd doesn't restart the process. exit(0); diff --git a/chrome/common/service_process_util_posix.h b/chrome/common/service_process_util_posix.h index 3d3533c..2f841bb 100644 --- a/chrome/common/service_process_util_posix.h +++ b/chrome/common/service_process_util_posix.h @@ -68,7 +68,7 @@ struct ServiceProcessState::StateData #if defined(OS_MACOSX) bool WatchExecutable(); - base::mac::ScopedCFTypeRef<CFDictionaryRef> launchd_conf_; + base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf_; base::FilePathWatcher executable_watcher_; #endif // OS_MACOSX #if defined(OS_POSIX) && !defined(OS_MACOSX) |