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

Unified Diff: runtime/bin/builtin_natives.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 | « no previous file | runtime/bin/file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin_natives.cc
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index ad7f6e1abb6df4c1d7a0258884e8fac1ac18ff11..f737132ab0b1e0fe8f67e1825e35c51994923ffe 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -13,6 +13,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
+#include "bin/file.h"
#include "bin/io_natives.h"
#include "bin/platform.h"
@@ -79,9 +80,6 @@ const uint8_t* Builtin::NativeSymbol(Dart_NativeFunction nf) {
}
-extern bool capture_stdout;
-
-
// Implementation of native functions which are used for some
// test/debug functionality in standalone dart mode.
void FUNCTION_NAME(Builtin_PrintString)(Dart_NativeArguments args) {
@@ -95,7 +93,7 @@ void FUNCTION_NAME(Builtin_PrintString)(Dart_NativeArguments args) {
fwrite(chars, 1, length, stdout);
fputs("\n", stdout);
fflush(stdout);
- if (capture_stdout) {
+ if (File::capture_stdout()) {
// For now we report print output on the Stdout stream.
uint8_t newline[] = { '\n' };
Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length);
« no previous file with comments | « no previous file | runtime/bin/file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698