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

Unified Diff: chrome/browser/browser_init.cc

Issue 4146004: ThreadRestrictions: disallow blocking IO on the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more 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
Index: chrome/browser/browser_init.cc
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 731e405d580ec67a9c13f98cd7cd9a671b31bfcd..c1ab3a9fd2d19b4fae78318f03c6e96e12797b74 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -15,6 +15,7 @@
#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/string_number_conversions.h"
+#include "base/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/automation/automation_provider_list.h"
@@ -851,7 +852,14 @@ std::vector<GURL> BrowserInit::LaunchWithProfile::GetURLsFromCommandLine(
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())));
} else {
// This will create a file URL or a regular URL.
- GURL url(URLFixerUpper::FixupRelativeFile(cur_dir_, param));
+ // This call can (in rare circumstances) block the UI thread.
+ // Allow it until this bug is fixed.
+ // http://code.google.com/p/chromium/issues/detail?id=60641
+ GURL url;
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ url = URLFixerUpper::FixupRelativeFile(cur_dir_, param);
+ }
// Exclude dangerous schemes.
if (url.is_valid()) {
ChildProcessSecurityPolicy *policy =

Powered by Google App Engine
This is Rietveld 408576698