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 CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 5 #ifndef CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
6 #define CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 6 #define CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Reports terminal resize to process proxy. | 51 // Reports terminal resize to process proxy. |
52 bool OnTerminalResize(int id, int width, int height); | 52 bool OnTerminalResize(int id, int width, int height); |
53 // Notifies process proxy identified by |id| that previously reported output | 53 // Notifies process proxy identified by |id| that previously reported output |
54 // has been handled. | 54 // has been handled. |
55 void AckOutput(int id); | 55 void AckOutput(int id); |
56 | 56 |
57 // Shuts down registry, closing all associated processed. | 57 // Shuts down registry, closing all associated processed. |
58 void ShutDown(); | 58 void ShutDown(); |
59 | 59 |
60 private: | 60 private: |
61 friend struct ::base::DefaultLazyInstanceTraits<ProcessProxyRegistry>; | 61 friend struct ::base::LazyInstanceTraitsBase<ProcessProxyRegistry>; |
62 | 62 |
63 ProcessProxyRegistry(); | 63 ProcessProxyRegistry(); |
64 ~ProcessProxyRegistry(); | 64 ~ProcessProxyRegistry(); |
65 | 65 |
66 // Gets called when output gets detected. | 66 // Gets called when output gets detected. |
67 void OnProcessOutput(int id, ProcessOutputType type, const std::string& data); | 67 void OnProcessOutput(int id, ProcessOutputType type, const std::string& data); |
68 | 68 |
69 bool EnsureWatcherThreadStarted(); | 69 bool EnsureWatcherThreadStarted(); |
70 | 70 |
71 // Map of all existing ProcessProxies. | 71 // Map of all existing ProcessProxies. |
72 std::map<int, ProcessProxyInfo> proxy_map_; | 72 std::map<int, ProcessProxyInfo> proxy_map_; |
73 | 73 |
74 std::unique_ptr<base::Thread> watcher_thread_; | 74 std::unique_ptr<base::Thread> watcher_thread_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry); | 76 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace chromeos | 79 } // namespace chromeos |
80 | 80 |
81 #endif // CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 81 #endif // CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
OLD | NEW |