summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 05:16:56 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 05:16:56 +0000
commit3c2a3d1369b6fe67239f8dbea1e4879748781f96 (patch)
tree65cad25448502dd03998a84cb2263574ba3f5de2
parent3b073b258b19937b1dd9b6b2a609dee207865eba (diff)
downloadchromium_src-3c2a3d1369b6fe67239f8dbea1e4879748781f96.zip
chromium_src-3c2a3d1369b6fe67239f8dbea1e4879748781f96.tar.gz
chromium_src-3c2a3d1369b6fe67239f8dbea1e4879748781f96.tar.bz2
Run ShellExecute on the file thread instead of the IO thread. ShellExecute can
be janky so we don't want to be calling it on the IO thread. The file thread is really the "blocking io" thread, and it's where we call ShellExecute for other things. R=nsylvain Review URL: http://codereview.chromium.org/18120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8166 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/external_protocol_handler.cc8
-rw-r--r--chrome/browser/external_protocol_handler.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/external_protocol_handler.cc b/chrome/browser/external_protocol_handler.cc
index 24423ac..18ff2bf 100644
--- a/chrome/browser/external_protocol_handler.cc
+++ b/chrome/browser/external_protocol_handler.cc
@@ -129,13 +129,15 @@ void ExternalProtocolHandler::LaunchUrl(const GURL& url,
return;
}
- MessageLoop* io_loop = g_browser_process->io_thread()->message_loop();
- if (io_loop == NULL) {
+ // Put this work on the file thread since ShellExecute may block for a
+ // significant amount of time.
+ MessageLoop* loop = g_browser_process->file_thread()->message_loop();
+ if (loop == NULL) {
return;
}
// Otherwise the protocol is white-listed, so go ahead and launch.
- io_loop->PostTask(FROM_HERE,
+ loop->PostTask(FROM_HERE,
NewRunnableFunction(
&ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck,
escaped_url));
diff --git a/chrome/browser/external_protocol_handler.h b/chrome/browser/external_protocol_handler.h
index 75f3f93..830c290 100644
--- a/chrome/browser/external_protocol_handler.h
+++ b/chrome/browser/external_protocol_handler.h
@@ -42,7 +42,7 @@ class ExternalProtocolHandler {
// NOTE: You should Not call this function directly unless you are sure the
// url you have has been checked against the blacklist, and has been escaped.
// All calls to this function should originate in some way from LaunchUrl.
- // Must run on the IO thread.
+ // Must run on the file thread.
static void LaunchUrlWithoutSecurityCheck(const GURL& url);
// Prepopulates the dictionary with known protocols to deny or allow, if