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/app_controller_mac.mm

Issue 22966010: Call RecordLastRunAppBundlePath in FILE thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call RecordLastRunAppBundlePath immediately Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index b2d30cd729b218d5ba29660d95841d367c9cfb2e..d25953b6e6310b047e27ec4e3154c470ac9a4ecd 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -165,6 +165,8 @@ void RecordLastRunAppBundlePath() {
// real, user-visible app bundle directory. (The alternatives give either the
// framework's path or the initial app's path, which may be an app mode shim
// or a unit test.)
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+
base::FilePath appBundlePath =
chrome::GetVersionedDirectory().DirName().DirName().DirName();
CFPreferencesSetAppValue(
@@ -671,8 +673,11 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
[NSApp setHelpMenu:helpMenu_];
// Record the path to the (browser) app bundle; this is used by the app mode
- // shim.
- RecordLastRunAppBundlePath();
+ // shim. It has to be done in FILE thread because getting the path requires
+ // I/O.
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&RecordLastRunAppBundlePath));
// Makes "Services" menu items available.
[self registerServicesMenuTypesTo:[notify object]];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698