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

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

Issue 12433023: Move chrome/browser/chromeos/process_proxy to chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/process_proxy/OWNERS ('k') | chromeos/process_proxy/process_output_watcher.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 CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_ 5 #ifndef CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_
6 #define CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_ 6 #define CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "chromeos/chromeos_export.h"
11 12
12 namespace { 13 namespace {
13 14
14 const int kReadBufferSize = 256; 15 const int kReadBufferSize = 256;
15 16
16 } // namespace 17 } // namespace
17 18
19 namespace chromeos {
20
18 enum ProcessOutputType { 21 enum ProcessOutputType {
19 PROCESS_OUTPUT_TYPE_OUT, 22 PROCESS_OUTPUT_TYPE_OUT,
20 PROCESS_OUTPUT_TYPE_ERR, 23 PROCESS_OUTPUT_TYPE_ERR,
21 PROCESS_OUTPUT_TYPE_EXIT 24 PROCESS_OUTPUT_TYPE_EXIT
22 }; 25 };
23 26
24 typedef base::Callback<void(ProcessOutputType, const std::string&)> 27 typedef base::Callback<void(ProcessOutputType, const std::string&)>
25 ProcessOutputCallback; 28 ProcessOutputCallback;
26 29
27 // This class should live on its own thread because running class makes 30 // This class should live on its own thread because running class makes
28 // underlying thread block. It deletes itself when watching is stopped. 31 // underlying thread block. It deletes itself when watching is stopped.
29 class ProcessOutputWatcher { 32 class CHROMEOS_EXPORT ProcessOutputWatcher {
30 public: 33 public:
31 ProcessOutputWatcher(int out_fd, int stop_fd, 34 ProcessOutputWatcher(int out_fd, int stop_fd,
32 const ProcessOutputCallback& callback); 35 const ProcessOutputCallback& callback);
33 36
34 // This will block current thread!!!! 37 // This will block current thread!!!!
35 void Start(); 38 void Start();
36 39
37 private: 40 private:
38 // The object will destroy itself when it stops watching process output. 41 // The object will destroy itself when it stops watching process output.
39 ~ProcessOutputWatcher(); 42 ~ProcessOutputWatcher();
(...skipping 17 matching lines...) Expand all
57 60
58 int out_fd_; 61 int out_fd_;
59 int stop_fd_; 62 int stop_fd_;
60 int max_fd_; 63 int max_fd_;
61 64
62 // Callback that will be invoked when some output is detected. 65 // Callback that will be invoked when some output is detected.
63 ProcessOutputCallback on_read_callback_; 66 ProcessOutputCallback on_read_callback_;
64 67
65 DISALLOW_COPY_AND_ASSIGN(ProcessOutputWatcher); 68 DISALLOW_COPY_AND_ASSIGN(ProcessOutputWatcher);
66 }; 69 };
67 #endif // CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_ 70
71 } // namespace chromeos
72
73 #endif // CHROMEOS_PROCESS_PROXY_PROCESS_OUTPUT_WATCHER_H_
OLDNEW
« no previous file with comments | « chromeos/process_proxy/OWNERS ('k') | chromeos/process_proxy/process_output_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698