| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
| 16 #include "chrome/browser/chromeos/process_proxy/process_proxy.h" | 16 #include "chrome/browser/chromeos/process_proxy/process_proxy.h" |
| 17 | 17 |
| 18 typedef base::Callback<void(pid_t, std::string, std::string)> | 18 typedef base::Callback<void(pid_t, const std::string&, const std::string&)> |
| 19 ProcessOutputCallbackWithPid; | 19 ProcessOutputCallbackWithPid; |
| 20 | 20 |
| 21 // Keeps track of all created ProcessProxies. It is created lazily and should | 21 // Keeps track of all created ProcessProxies. It is created lazily and should |
| 22 // live on the FILE thread (where all methods must be called). | 22 // live on the FILE thread (where all methods must be called). |
| 23 class ProcessProxyRegistry { | 23 class ProcessProxyRegistry { |
| 24 public: | 24 public: |
| 25 // Info we need about a ProcessProxy instance. | 25 // Info we need about a ProcessProxy instance. |
| 26 struct ProcessProxyInfo { | 26 struct ProcessProxyInfo { |
| 27 scoped_refptr<ProcessProxy> proxy; | 27 scoped_refptr<ProcessProxy> proxy; |
| 28 scoped_ptr<base::Thread> watcher_thread; | 28 scoped_ptr<base::Thread> watcher_thread; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const std::string& output_type, | 64 const std::string& output_type, |
| 65 const std::string& output); | 65 const std::string& output); |
| 66 | 66 |
| 67 // Map of all existing ProcessProxies. | 67 // Map of all existing ProcessProxies. |
| 68 std::map<pid_t, ProcessProxyInfo> proxy_map_; | 68 std::map<pid_t, ProcessProxyInfo> proxy_map_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry); | 70 DISALLOW_COPY_AND_ASSIGN(ProcessProxyRegistry); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 #endif // CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ | 73 #endif // CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_REGISTRY_H_ |
| 74 | |
| OLD | NEW |