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

Unified Diff: base/test/launcher/test_launcher.cc

Issue 197873014: Revert of Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/launch_posix.cc ('k') | chrome/browser/chromeos/system/automatic_reboot_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 889244d92662021b20f79694528edd70170ef7b0..c25b00a3c5e157bebce14c317b5242c2a65a599d 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -14,7 +14,6 @@
#include "base/environment.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
-#include "base/files/scoped_file.h"
#include "base/format_macros.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -245,14 +244,16 @@
options.new_process_group = true;
base::FileHandleMappingVector fds_mapping;
- base::ScopedFD output_file_fd;
+ file_util::ScopedFD output_file_fd_closer;
if (redirect_stdio) {
- output_file_fd.reset(open(output_file.value().c_str(), O_RDWR));
- CHECK(output_file_fd.is_valid());
-
- fds_mapping.push_back(std::make_pair(output_file_fd.get(), STDOUT_FILENO));
- fds_mapping.push_back(std::make_pair(output_file_fd.get(), STDERR_FILENO));
+ int output_file_fd = open(output_file.value().c_str(), O_RDWR);
+ CHECK_GE(output_file_fd, 0);
+
+ output_file_fd_closer.reset(&output_file_fd);
+
+ fds_mapping.push_back(std::make_pair(output_file_fd, STDOUT_FILENO));
+ fds_mapping.push_back(std::make_pair(output_file_fd, STDERR_FILENO));
options.fds_to_remap = &fds_mapping;
}
#endif
@@ -263,10 +264,10 @@
if (redirect_stdio) {
#if defined(OS_WIN)
- FlushFileBuffers(handle.Get());
- handle.Close();
+ FlushFileBuffers(handle.Get());
+ handle.Close();
#elif defined(OS_POSIX)
- output_file_fd.reset();
+ output_file_fd_closer.reset();
#endif
}
« no previous file with comments | « base/process/launch_posix.cc ('k') | chrome/browser/chromeos/system/automatic_reboot_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698