Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: chrome/common/service_process_util_mac.mm

Issue 6793020: Move FilePathWatcher to base/files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move OWNERS file and rebase to pick up latest changes Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 bool RemoveFromLaunchd() { 74 bool RemoveFromLaunchd() {
75 // We're killing a file. 75 // We're killing a file.
76 base::ThreadRestrictions::AssertIOAllowed(); 76 base::ThreadRestrictions::AssertIOAllowed();
77 base::mac::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName()); 77 base::mac::ScopedCFTypeRef<CFStringRef> name(CopyServiceProcessLaunchDName());
78 return Launchd::GetInstance()->DeletePlist(Launchd::User, 78 return Launchd::GetInstance()->DeletePlist(Launchd::User,
79 Launchd::Agent, 79 Launchd::Agent,
80 name); 80 name);
81 } 81 }
82 82
83 class ExecFilePathWatcherDelegate : public FilePathWatcher::Delegate { 83 class ExecFilePathWatcherDelegate
84 : public base::files::FilePathWatcher::Delegate {
84 public: 85 public:
85 ExecFilePathWatcherDelegate() { } 86 ExecFilePathWatcherDelegate() { }
86 virtual ~ExecFilePathWatcherDelegate() { } 87 virtual ~ExecFilePathWatcherDelegate() { }
87 88
88 bool Init(const FilePath& path); 89 bool Init(const FilePath& path);
89 virtual void OnFilePathChanged(const FilePath& path) OVERRIDE; 90 virtual void OnFilePathChanged(const FilePath& path) OVERRIDE;
90 91
91 private: 92 private:
92 FSRef executable_fsref_; 93 FSRef executable_fsref_;
93 }; 94 };
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 CFErrorRef err = NULL; 434 CFErrorRef err = NULL;
434 if (!Launchd::GetInstance()->RemoveJob(label, &err)) { 435 if (!Launchd::GetInstance()->RemoveJob(label, &err)) {
435 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err); 436 base::mac::ScopedCFTypeRef<CFErrorRef> scoped_err(err);
436 LOG(ERROR) << "RemoveJob " << err; 437 LOG(ERROR) << "RemoveJob " << err;
437 // Exiting with zero, so launchd doesn't restart the process. 438 // Exiting with zero, so launchd doesn't restart the process.
438 exit(0); 439 exit(0);
439 } 440 }
440 } 441 }
441 } 442 }
442 } 443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698