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

Unified Diff: runtime/bin/main.cc

Issue 1458983002: Don't use global variables for capturing stdio. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 7ee1de1f15903d087f0070ac3d5e1cc0297bd3e3..72c54602f8cc73276cab6e0b5ac029ba7c17d209 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1055,21 +1055,16 @@ static const char* ServiceGetIOHandler(
}
-extern bool capture_stdio;
-extern bool capture_stdout;
-extern bool capture_stderr;
static const char* kStdoutStreamId = "Stdout";
static const char* kStderrStreamId = "Stderr";
static bool ServiceStreamListenCallback(const char* stream_id) {
if (strcmp(stream_id, kStdoutStreamId) == 0) {
- capture_stdio = true;
- capture_stdout = true;
+ File::set_capture_stdout(true);
return true;
} else if (strcmp(stream_id, kStderrStreamId) == 0) {
- capture_stdio = true;
- capture_stderr = true;
+ File::set_capture_stderr(true);
return true;
}
return false;
@@ -1078,11 +1073,10 @@ static bool ServiceStreamListenCallback(const char* stream_id) {
static void ServiceStreamCancelCallback(const char* stream_id) {
if (strcmp(stream_id, kStdoutStreamId) == 0) {
- capture_stdout = false;
+ File::set_capture_stdout(false);
} else if (strcmp(stream_id, kStderrStreamId) == 0) {
- capture_stderr = false;
+ File::set_capture_stderr(false);
}
- capture_stdio = (capture_stdout || capture_stderr);
}
« no previous file with comments | « runtime/bin/file.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698