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

Side by Side Diff: chromeos/process_proxy/process_proxy_registry.h

Issue 2909113003: Deprecate NonThreadSafe in chromeos/process_proxy in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 6 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | chromeos/process_proxy/process_proxy_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/threading/non_thread_safe.h" 16 #include "base/sequence_checker.h"
17 #include "base/threading/thread.h" 17 #include "base/threading/thread.h"
18 #include "chromeos/chromeos_export.h" 18 #include "chromeos/chromeos_export.h"
19 #include "chromeos/process_proxy/process_proxy.h" 19 #include "chromeos/process_proxy/process_proxy.h"
20 20
21 namespace chromeos { 21 namespace chromeos {
22 22
23 // Keeps track of all created ProcessProxies. It is created lazily and should 23 // Keeps track of all created ProcessProxies. It is created lazily and should
24 // live on a single thread (where all methods must be called). 24 // live on a single thread (where all methods must be called).
25 class CHROMEOS_EXPORT ProcessProxyRegistry : public base::NonThreadSafe { 25 class CHROMEOS_EXPORT ProcessProxyRegistry {
26 public: 26 public:
27 using OutputCallback = base::Callback<void(int terminal_id, 27 using OutputCallback = base::Callback<void(int terminal_id,
28 const std::string& output_type, 28 const std::string& output_type,
29 const std::string& output_data)>; 29 const std::string& output_data)>;
30 30
31 // Info we need about a ProcessProxy instance. 31 // Info we need about a ProcessProxy instance.
32 struct ProcessProxyInfo { 32 struct ProcessProxyInfo {
33 scoped_refptr<ProcessProxy> proxy; 33 scoped_refptr<ProcessProxy> proxy;
34 OutputCallback callback; 34 OutputCallback callback;
35 35
(...skipping 30 matching lines...) Expand all
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 SEQUENCE_CHECKER(sequence_checker_);
77
76 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry); 78 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry);
77 }; 79 };
78 80
79 } // namespace chromeos 81 } // namespace chromeos
80 82
81 #endif // CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ 83 #endif // CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_
OLDNEW
« no previous file with comments | « no previous file | chromeos/process_proxy/process_proxy_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698