Revert 257577 "Revert 257562 "Base: Make base::File use ScopedFD..."

Reland this: turns out not responsible.

> Revert 257562 "Base: Make base::File use ScopedFD on POSIX."
> 
> Might caused a bunch of layout test failures, at least on Linux
> 
> fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html,
> fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html,
> fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html,
> fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
> 
> > Base: Make base::File use ScopedFD on POSIX.
> > 
> > Now that ScopedFD lives outside of file_util, File can use it to remove manual
> > lifetime management.
> > 
> > This also standarizes the behavior on Close failures for all platforms.
> > 
> > BUG=none
> > 
> > Review URL: https://codereview.chromium.org/201083002
> 
> TBR=rvargas@chromium.org
> 
> Review URL: https://codereview.chromium.org/202583005

TBR=zmo@chromium.org

Review URL: https://codereview.chromium.org/202493007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257581 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 49ec031c22cdccd490e5ea328c2c01a98e793e21
diff --git a/base/files/file.cc b/base/files/file.cc
index 478f902..cd167b1 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -40,6 +40,9 @@
       error_details_(FILE_OK),
       created_(false),
       async_(false) {
+#if defined(OS_POSIX)
+  DCHECK_GE(platform_file, -1);
+#endif
 }
 
 File::File(RValue other)
@@ -50,7 +53,6 @@
 }
 
 File::~File() {
-  Close();
 }
 
 File& File::operator=(RValue other) {