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

Side by Side Diff: subprocess.h

Issue 3398011: AU: Mix stdout and stderr together in the logs. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Created 10 years, 3 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 | « no previous file | subprocess.cc » ('j') | subprocess.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return false; 56 return false;
57 } 57 }
58 private: 58 private:
59 // The global instance 59 // The global instance
60 static Subprocess* subprocess_singleton_; 60 static Subprocess* subprocess_singleton_;
61 61
62 // Callback for when any subprocess terminates. This calls the user 62 // Callback for when any subprocess terminates. This calls the user
63 // requested callback. 63 // requested callback.
64 static void GChildExitedCallback(GPid pid, gint status, gpointer data); 64 static void GChildExitedCallback(GPid pid, gint status, gpointer data);
65 65
66 // Callback which runs in the child before exec to redirect stderr onto
67 // stdout.
68 static void GRedirectStderrToStdout(gpointer user_data);
69
66 struct SubprocessCallbackRecord { 70 struct SubprocessCallbackRecord {
67 ExecCallback callback; 71 ExecCallback callback;
68 void* callback_data; 72 void* callback_data;
69 }; 73 };
70 74
71 std::map<int, SubprocessCallbackRecord> callback_records_; 75 std::map<int, SubprocessCallbackRecord> callback_records_;
72 76
73 Subprocess() {} 77 Subprocess() {}
74 DISALLOW_COPY_AND_ASSIGN(Subprocess); 78 DISALLOW_COPY_AND_ASSIGN(Subprocess);
75 }; 79 };
76 80
77 } // namespace chromeos_update_engine 81 } // namespace chromeos_update_engine
78 82
79 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__ 83 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_SUBPROCESS_H__
OLDNEW
« no previous file with comments | « no previous file | subprocess.cc » ('j') | subprocess.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698