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

Unified Diff: chrome/browser/external_protocol/external_protocol_handler.cc

Issue 8769013: Remove BrowserThread::UnsafeGetBrowserThread, add UnsafeGetMessageLoopForThread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to lkgr (pure merge). Created 9 years 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 | « chrome/browser/chromeos/version_loader.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/external_protocol/external_protocol_handler.cc
diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc
index a3b45b34ef7be40165288af8e2c1bc820644746f..ee497cc68104c898aead265fb0dd5d16cb3771d2 100644
--- a/chrome/browser/external_protocol/external_protocol_handler.cc
+++ b/chrome/browser/external_protocol/external_protocol_handler.cc
@@ -17,9 +17,12 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
+using content::BrowserThread;
+
// Whether we accept requests for launching external protocols. This is set to
// false every time an external protocol is requested, and set back to true on
// each user gesture. This variable should only be accessed from the UI thread.
@@ -283,12 +286,10 @@ void ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(const GURL& url) {
#else
// Otherwise put this work on the file thread. On Windows ShellExecute may
// block for a significant amount of time, and it shouldn't hurt on Linux.
- MessageLoop* loop = g_browser_process->file_thread()->message_loop();
- if (loop == NULL) {
- return;
- }
-
- loop->PostTask(FROM_HERE, base::Bind(&platform_util::OpenExternal, url));
+ BrowserThread::PostTask(
+ BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(&platform_util::OpenExternal, url));
#endif
}
« no previous file with comments | « chrome/browser/chromeos/version_loader.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698