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

Unified Diff: chrome/browser/process_singleton.h

Issue 11099053: Refactor ProcessSingleton to allow a Desktop process to activate Metro Chrome cleanly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r170957 Created 8 years 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 | « no previous file | chrome/browser/process_singleton_win.cc » ('j') | chrome/browser/process_singleton_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton.h
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index cdf3a61f2e25b12f6d35e99d1fb765a1d74625ea..8a07f539c0b300c5aba41f9621ca419035ff049b 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -24,16 +24,11 @@
#include "base/threading/non_thread_safe.h"
#include "ui/gfx/native_widget_types.h"
-#if defined(OS_POSIX)
-#include "base/file_path.h"
-#endif // defined(OS_POSIX)
-
#if defined(OS_LINUX) || defined(OS_OPENBSD)
#include "base/files/scoped_temp_dir.h"
#endif // defined(OS_LINUX) || defined(OS_OPENBSD)
class CommandLine;
-class FilePath;
// ProcessSingleton ----------------------------------------------------------
//
@@ -70,7 +65,11 @@ class ProcessSingleton : public base::NonThreadSafe {
// Notify another process, if available. Otherwise sets ourselves as the
// singleton instance and stores the provided callback for notification from
// future processes. Returns PROCESS_NONE if we became the singleton
- // instance.
+ // instance. Callers are guaranteed to either have notified an existing
+ // process or have grabbed the singleton (unless the profile is locked by an
+ // unreachable process).
+ // TODO(brettw): Make the implementation of this method non-platform-specific
+ // by making Linux re-use the Windows implementation.
NotifyResult NotifyOtherProcessOrCreate(
const NotificationCallback& notification_callback);
@@ -120,13 +119,9 @@ class ProcessSingleton : public base::NonThreadSafe {
protected:
// Notify another process, if available.
- // Returns true if another process was found and notified, false if we
- // should continue with this process.
- // Windows code roughly based on Mozilla.
- //
- // TODO(brettw): this will not handle all cases. If two processes start up too
- // close to each other, the Create() might not yet have happened for the
- // first one, so this function won't find it.
+ // Returns true if another process was found and notified, false if we should
+ // continue with the current process.
+ // On Windows, Create() has to be called before this.
NotifyResult NotifyOtherProcess();
#if defined(OS_LINUX) || defined(OS_OPENBSD)
@@ -167,6 +162,7 @@ class ProcessSingleton : public base::NonThreadSafe {
HWND window_; // The HWND_MESSAGE window.
bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment.
HANDLE lock_file_;
+ FilePath user_data_dir_;
#elif defined(OS_LINUX) || defined(OS_OPENBSD)
// Return true if the given pid is one of our child processes.
// Assumes that the current pid is the root of all pids of the current
« no previous file with comments | « no previous file | chrome/browser/process_singleton_win.cc » ('j') | chrome/browser/process_singleton_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698