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

Unified Diff: chrome/common/service_process_util_posix.h

Issue 2438913003: Require FilePathWatcher destructor to be called in sequence with Watch(). (Closed)
Patch Set: CR thestig #36 (fix comment) Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util_posix.h
diff --git a/chrome/common/service_process_util_posix.h b/chrome/common/service_process_util_posix.h
index 2a5339e7099b48088c855868a4f2781aeb751bcf..be6ec4831ce716020a31f39dc5bbf007fb44fc26 100644
--- a/chrome/common/service_process_util_posix.h
+++ b/chrome/common/service_process_util_posix.h
@@ -12,7 +12,9 @@
#include <memory>
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
#if defined(OS_POSIX) && !defined(OS_MACOSX)
@@ -57,9 +59,9 @@ class ServiceProcessTerminateMonitor : public base::MessageLoopForIO::Watcher {
base::Closure terminate_task_;
};
-struct ServiceProcessState::StateData
- : public base::RefCountedThreadSafe<ServiceProcessState::StateData> {
+struct ServiceProcessState::StateData {
StateData();
+ ~StateData();
// WatchFileDescriptor needs to be set up by the thread that is going
// to be monitoring it.
@@ -70,8 +72,7 @@ struct ServiceProcessState::StateData
base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf;
base::FilePathWatcher executable_watcher;
-#endif // OS_MACOSX
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#else
std::unique_ptr<MultiProcessLock> initializing_lock;
std::unique_ptr<MultiProcessLock> running_lock;
#endif
@@ -81,9 +82,9 @@ struct ServiceProcessState::StateData
struct sigaction old_action;
bool set_action;
- protected:
- friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>;
- virtual ~StateData();
+ // The SingleThreadTaskRunner on which SignalReady and the destructor are
+ // invoked.
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner;
};
#endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_POSIX_H_
« no previous file with comments | « chrome/common/service_process_util.h ('k') | chrome/common/service_process_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698