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

Unified Diff: runtime/bin/file.h

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/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index 633c006175fa77f3f081815644e2b4b85f2a5b3e..28e85e3d8ed7996e15fbd6ba5b7d538c598a8e94 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -187,6 +187,18 @@ class File {
static CObject* StatRequest(const CObjectArray& request);
static CObject* LockRequest(const CObjectArray& request);
+ static void set_capture_stdout(bool value) {
+ capture_stdout_ = value;
+ capture_any_ = (capture_stdout_ || capture_stderr_);
+ }
+ static bool capture_stdout() { return capture_stdout_; }
+
+ static void set_capture_stderr(bool value) {
+ capture_stderr_ = value;
+ capture_any_ = (capture_stdout_ || capture_stderr_);
+ }
+ static bool capture_stderr() { return capture_stderr_; }
+
private:
explicit File(FileHandle* handle) : handle_(handle) { }
void Close();
@@ -196,6 +208,10 @@ class File {
// FileHandle is an OS specific class which stores data about the file.
FileHandle* handle_; // OS specific handle for the file.
+ static bool capture_stdout_;
+ static bool capture_stderr_;
+ static bool capture_any_;
+
DISALLOW_COPY_AND_ASSIGN(File);
};
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698