| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PROCESS_SINGLETON_H_ | 5 #ifndef CHROME_BROWSER_PROCESS_SINGLETON_H_ |
| 6 #define CHROME_BROWSER_PROCESS_SINGLETON_H_ | 6 #define CHROME_BROWSER_PROCESS_SINGLETON_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/memory/ref_counted.h" | 22 #include "base/memory/ref_counted.h" |
| 23 #include "base/process.h" | 23 #include "base/process.h" |
| 24 #include "base/threading/non_thread_safe.h" | 24 #include "base/threading/non_thread_safe.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
| 26 | 26 |
| 27 #if defined(OS_POSIX) | 27 #if defined(OS_POSIX) |
| 28 #include "base/file_path.h" | 28 #include "base/file_path.h" |
| 29 #endif // defined(OS_POSIX) | 29 #endif // defined(OS_POSIX) |
| 30 | 30 |
| 31 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 31 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 32 #include "base/scoped_temp_dir.h" | 32 #include "base/files/scoped_temp_dir.h" |
| 33 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) | 33 #endif // defined(OS_LINUX) || defined(OS_OPENBSD) |
| 34 | 34 |
| 35 class CommandLine; | 35 class CommandLine; |
| 36 class FilePath; | 36 class FilePath; |
| 37 | 37 |
| 38 // ProcessSingleton ---------------------------------------------------------- | 38 // ProcessSingleton ---------------------------------------------------------- |
| 39 // | 39 // |
| 40 // This class allows different browser processes to communicate with | 40 // This class allows different browser processes to communicate with |
| 41 // each other. It is named according to the user data directory, so | 41 // each other. It is named according to the user data directory, so |
| 42 // we can be sure that no more than one copy of the application can be | 42 // we can be sure that no more than one copy of the application can be |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Path in file system to the socket. | 197 // Path in file system to the socket. |
| 198 FilePath socket_path_; | 198 FilePath socket_path_; |
| 199 | 199 |
| 200 // Path in file system to the lock. | 200 // Path in file system to the lock. |
| 201 FilePath lock_path_; | 201 FilePath lock_path_; |
| 202 | 202 |
| 203 // Path in file system to the cookie file. | 203 // Path in file system to the cookie file. |
| 204 FilePath cookie_path_; | 204 FilePath cookie_path_; |
| 205 | 205 |
| 206 // Temporary directory to hold the socket. | 206 // Temporary directory to hold the socket. |
| 207 ScopedTempDir socket_dir_; | 207 base::ScopedTempDir socket_dir_; |
| 208 | 208 |
| 209 // Helper class for linux specific messages. LinuxWatcher is ref counted | 209 // Helper class for linux specific messages. LinuxWatcher is ref counted |
| 210 // because it posts messages between threads. | 210 // because it posts messages between threads. |
| 211 class LinuxWatcher; | 211 class LinuxWatcher; |
| 212 scoped_refptr<LinuxWatcher> watcher_; | 212 scoped_refptr<LinuxWatcher> watcher_; |
| 213 #elif defined(OS_MACOSX) | 213 #elif defined(OS_MACOSX) |
| 214 // Path in file system to the lock. | 214 // Path in file system to the lock. |
| 215 FilePath lock_path_; | 215 FilePath lock_path_; |
| 216 | 216 |
| 217 // File descriptor associated with the lockfile, valid between | 217 // File descriptor associated with the lockfile, valid between |
| 218 // |Create()| and |Cleanup()|. Two instances cannot have a lock on | 218 // |Create()| and |Cleanup()|. Two instances cannot have a lock on |
| 219 // the same file at the same time. | 219 // the same file at the same time. |
| 220 int lock_fd_; | 220 int lock_fd_; |
| 221 #endif | 221 #endif |
| 222 | 222 |
| 223 // If messages are received in the locked state, the corresponding command | 223 // If messages are received in the locked state, the corresponding command |
| 224 // lines are saved here to be replayed later. | 224 // lines are saved here to be replayed later. |
| 225 std::vector<DelayedStartupMessage> saved_startup_messages_; | 225 std::vector<DelayedStartupMessage> saved_startup_messages_; |
| 226 | 226 |
| 227 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); | 227 DISALLOW_COPY_AND_ASSIGN(ProcessSingleton); |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ | 230 #endif // CHROME_BROWSER_PROCESS_SINGLETON_H_ |
| OLD | NEW |