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

Unified Diff: chrome/browser/extensions/autoupdate_interceptor.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 | « base/thread_restrictions.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/autoupdate_interceptor.cc
diff --git a/chrome/browser/extensions/autoupdate_interceptor.cc b/chrome/browser/extensions/autoupdate_interceptor.cc
index 2acd0a0f968c2e945fa676887306ad869a4f64f5..ef0091f9871e61286071635b9c5324c2f91f5229 100644
--- a/chrome/browser/extensions/autoupdate_interceptor.cc
+++ b/chrome/browser/extensions/autoupdate_interceptor.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/autoupdate_interceptor.h"
#include "base/file_util.h"
+#include "base/thread_restrictions.h"
#include "chrome/browser/browser_thread.h"
#include "net/url_request/url_request_test_job.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,6 +41,10 @@ URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
return NULL;
}
+ // It's ok to do a blocking disk access on this thread; this class
+ // is just used for tests.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
// Search for this request's url, ignoring any query parameters.
GURL url = request->url();
if (url.has_query()) {
@@ -61,6 +66,9 @@ URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
void AutoUpdateInterceptor::SetResponse(const std::string url,
const FilePath& path) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ // It's ok to do a blocking disk access on this thread; this class
+ // is just used for tests.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
GURL gurl(url);
EXPECT_EQ("http", gurl.scheme());
EXPECT_EQ("localhost", gurl.host());
« no previous file with comments | « base/thread_restrictions.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698