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

Unified Diff: chrome/browser/ui/webui/profile_helper.cc

Issue 2516613002: Profile deletion: prevent profile creation race in dying browser. (Closed)
Patch Set: Created 4 years, 1 month 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/ui/webui/profile_helper.cc
diff --git a/chrome/browser/ui/webui/profile_helper.cc b/chrome/browser/ui/webui/profile_helper.cc
index 04bf70c1d48674c254e061abfb8d005d096f9794..77483260bd74a70bb45873c285276e0791cc51cb 100644
--- a/chrome/browser/ui/webui/profile_helper.cc
+++ b/chrome/browser/ui/webui/profile_helper.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/lifetime/keep_alive_types.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_window.h"
@@ -27,7 +28,9 @@ void ShowSigninDialog(base::FilePath signin_profile_path,
}
} // namespace
Bernhard Bauer 2016/11/18 13:31:31 And after this one?
-void OpenNewWindowForProfile(Profile* profile, Profile::CreateStatus status) {
+void OpenNewWindowForProfile(const std::unique_ptr<ScopedKeepAlive>& keep_alive,
Bernhard Bauer 2016/11/18 13:31:31 Both the ScopedKeepAlive and the CreateStatus are
+ Profile* profile,
+ Profile::CreateStatus status) {
if (status != Profile::CREATE_STATUS_INITIALIZED)
return;
@@ -57,7 +60,11 @@ void DeleteProfileAtPath(base::FilePath file_path,
if (!profiles::IsMultipleProfilesEnabled())
return;
g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion(
- file_path, base::Bind(&OpenNewWindowForProfile), deletion_source);
+ file_path, base::Bind(&OpenNewWindowForProfile,
+ base::Passed(base::MakeUnique<ScopedKeepAlive>(
+ KeepAliveOrigin::PROFILE_HELPER,
+ KeepAliveRestartOption::DISABLED))),
+ deletion_source);
}
} // namespace webui
« chrome/browser/ui/webui/profile_helper.h ('K') | « chrome/browser/ui/webui/profile_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698