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

Unified Diff: chrome/common/service_process_util_posix.h

Issue 2514113003: Revert of Require FilePathWatcher destructor to be called in sequence with Watch(). (Closed)
Patch Set: 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 be6ec4831ce716020a31f39dc5bbf007fb44fc26..2a5339e7099b48088c855868a4f2781aeb751bcf 100644
--- a/chrome/common/service_process_util_posix.h
+++ b/chrome/common/service_process_util_posix.h
@@ -12,9 +12,7 @@
#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)
@@ -59,9 +57,9 @@
base::Closure terminate_task_;
};
-struct ServiceProcessState::StateData {
+struct ServiceProcessState::StateData
+ : public base::RefCountedThreadSafe<ServiceProcessState::StateData> {
StateData();
- ~StateData();
// WatchFileDescriptor needs to be set up by the thread that is going
// to be monitoring it.
@@ -72,7 +70,8 @@
base::ScopedCFTypeRef<CFDictionaryRef> launchd_conf;
base::FilePathWatcher executable_watcher;
-#else
+#endif // OS_MACOSX
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
std::unique_ptr<MultiProcessLock> initializing_lock;
std::unique_ptr<MultiProcessLock> running_lock;
#endif
@@ -82,9 +81,9 @@
struct sigaction old_action;
bool set_action;
- // The SingleThreadTaskRunner on which SignalReady and the destructor are
- // invoked.
- scoped_refptr<base::SingleThreadTaskRunner> task_runner;
+ protected:
+ friend class base::RefCountedThreadSafe<ServiceProcessState::StateData>;
+ virtual ~StateData();
};
#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