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

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: 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..936d1966271b41554a3a956491e6dd042d9b8576 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();
tapted 2013/08/22 23:28:04 drive-by: Is there an issue down the code path Ge
CFPreferencesSetAppValue(
@@ -172,11 +174,7 @@ void RecordLastRunAppBundlePath() {
base::SysUTF8ToCFStringRef(appBundlePath.value()),
BaseBundleID_CFString());
- // Sync after a delay avoid I/O contention on startup; 1500 ms is plenty.
- BrowserThread::PostDelayedTask(
- BrowserThread::FILE, FROM_HERE,
- base::Bind(&PrefsSyncCallback),
- base::TimeDelta::FromMilliseconds(1500));
+ PrefsSyncCallback();
}
} // anonymous namespace
@@ -671,8 +669,12 @@ 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. Sync after a delay avoid I/O contention on startup; 1500 ms is
+ // plenty.
+ BrowserThread::PostDelayedTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&RecordLastRunAppBundlePath),
+ base::TimeDelta::FromMilliseconds(1500));
// 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