summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 06:44:58 +0000
committermkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-03 06:44:58 +0000
commit676bfd3221b2b70db1a278d5193760278b0219f9 (patch)
tree3bd61bf0ca8098afefe7769d0b17721b37aff8f5
parent8ed7e7534ba6bc3211eb4bb19a55e8690c76c57c (diff)
downloadchromium_src-676bfd3221b2b70db1a278d5193760278b0219f9.zip
chromium_src-676bfd3221b2b70db1a278d5193760278b0219f9.tar.gz
chromium_src-676bfd3221b2b70db1a278d5193760278b0219f9.tar.bz2
Revert 120283 - net: Use ClosePlatformFile() instead of close/CloseHandle().
Review URL: http://codereview.chromium.org/9315062 TBR=satorux@chromium.org We're guessing that this is causing timeouts on the Windows browser tests, see http://build.chromium.org/p/chromium/builders/Win7%20Tests%20%28dbg%29%286%29/builds/2695/steps/browser_tests/logs/stdio for example. :( Review URL: https://chromiumcodereview.appspot.com/9307081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120290 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sessions/session_backend.cc6
-rw-r--r--content/browser/renderer_host/redirect_to_file_resource_handler.cc2
-rw-r--r--net/base/file_stream_posix.cc3
-rw-r--r--net/base/file_stream_win.cc3
-rw-r--r--net/url_request/url_request_file_job.cc3
-rw-r--r--webkit/blob/blob_url_request_job.cc2
6 files changed, 3 insertions, 16 deletions
diff --git a/chrome/browser/sessions/session_backend.cc b/chrome/browser/sessions/session_backend.cc
index ba9f9ad..f9d2b8c 100644
--- a/chrome/browser/sessions/session_backend.cc
+++ b/chrome/browser/sessions/session_backend.cc
@@ -9,7 +9,6 @@
#include "base/file_util.h"
#include "base/memory/scoped_vector.h"
#include "base/metrics/histogram.h"
-#include "base/threading/thread_restrictions.h"
#include "net/base/file_stream.h"
#include "net/base/net_errors.h"
@@ -344,11 +343,6 @@ bool SessionBackend::AppendCommandsToFile(net::FileStream* file,
}
SessionBackend::~SessionBackend() {
- if (current_session_file_.get()) {
- // Close() performs file IO. crbug.com/112512.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- current_session_file_->Close();
- }
}
void SessionBackend::ResetFile() {
diff --git a/content/browser/renderer_host/redirect_to_file_resource_handler.cc b/content/browser/renderer_host/redirect_to_file_resource_handler.cc
index 64e007b..e4147f0 100644
--- a/content/browser/renderer_host/redirect_to_file_resource_handler.cc
+++ b/content/browser/renderer_host/redirect_to_file_resource_handler.cc
@@ -139,8 +139,6 @@ void RedirectToFileResourceHandler::OnRequestClosed() {
if (file_stream_.get()) {
// We require this explicit call to Close since file_stream_ was constructed
// directly from a PlatformFile.
- // Close() performs file IO. crbug.com/112474.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
file_stream_->Close();
file_stream_.reset();
}
diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc
index a094eed..502d0f1 100644
--- a/net/base/file_stream_posix.cc
+++ b/net/base/file_stream_posix.cc
@@ -353,8 +353,9 @@ void FileStream::Close() {
async_context_.reset();
if (file_ != base::kInvalidPlatformFileValue) {
- if (!base::ClosePlatformFile(file_))
+ if (close(file_) != 0) {
NOTREACHED();
+ }
file_ = base::kInvalidPlatformFileValue;
bound_net_log_.EndEvent(net::NetLog::TYPE_FILE_STREAM_OPEN, NULL);
diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc
index 9e1f686f..1f7ecbf 100644
--- a/net/base/file_stream_win.cc
+++ b/net/base/file_stream_win.cc
@@ -181,8 +181,7 @@ void FileStream::Close() {
async_context_.reset();
if (file_ != INVALID_HANDLE_VALUE) {
- if (!base::ClosePlatformFile(file_))
- NOTREACHED();
+ CloseHandle(file_);
file_ = INVALID_HANDLE_VALUE;
bound_net_log_.EndEvent(net::NetLog::TYPE_FILE_STREAM_OPEN, NULL);
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 8f32750..d8187ab 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -158,9 +158,6 @@ void URLRequestFileJob::Start() {
}
void URLRequestFileJob::Kill() {
- // URL requests should not block on the disk!
- // http://code.google.com/p/chromium/issues/detail?id=59849
- base::ThreadRestrictions::ScopedAllowIO allow_io;
stream_.Close();
if (async_resolver_) {
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc
index 00d8317..46ffd21 100644
--- a/webkit/blob/blob_url_request_job.cc
+++ b/webkit/blob/blob_url_request_job.cc
@@ -100,8 +100,6 @@ void BlobURLRequestJob::DidStart() {
void BlobURLRequestJob::CloseStream() {
if (stream_ != NULL) {
- // stream_.Close() blocks the IO thread, see http://crbug.com/75548.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
stream_->Close();
stream_.reset(NULL);
}