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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 3872002: Thread IO safety: file_util annotated, IO thread blocked from doing IO (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 10 years, 2 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 | « net/socket/ssl_client_socket_nss.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_file_job.cc
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 8c282ffb231425981a5ac21ff49ec96d9ff2c438..f9c6559065022a43e9e018c1356af2ef499876e0 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -23,6 +23,7 @@
#include "base/message_loop.h"
#include "base/platform_file.h"
#include "base/string_util.h"
+#include "base/thread_restrictions.h"
#include "build/build_config.h"
#include "googleurl/src/gurl.h"
#include "net/base/io_buffer.h"
@@ -128,8 +129,15 @@ void URLRequestFileJob::Start() {
return;
}
#endif
+
+ // URL requests should not block on the disk!
+ // http://code.google.com/p/chromium/issues/detail?id=59849
+ bool exists;
base::PlatformFileInfo file_info;
- bool exists = file_util::GetFileInfo(file_path_, &file_info);
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ exists = file_util::GetFileInfo(file_path_, &file_info);
+ }
// Continue asynchronously.
MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698