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

Unified Diff: chrome/browser/ui/app_list/profile_loader.cc

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address PS7 comments, replace strings by a struct ptr, chromeappdelegate ctor takes a boolean Created 4 years, 10 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
Index: chrome/browser/ui/app_list/profile_loader.cc
diff --git a/chrome/browser/ui/app_list/profile_loader.cc b/chrome/browser/ui/app_list/profile_loader.cc
index ec8d9a4e4103d1c7b1245cadd7d168a92cbd2ecf..8f25c856245e7547e534ac9f90d975bfadd77fe2 100644
--- a/chrome/browser/ui/app_list/profile_loader.cc
+++ b/chrome/browser/ui/app_list/profile_loader.cc
@@ -6,10 +6,17 @@
#include "base/bind.h"
#include "base/files/file_path.h"
-#include "chrome/browser/apps/scoped_keep_alive.h"
+#include "chrome/browser/lifetime/keep_alive_options.h"
+#include "chrome/browser/lifetime/scoped_keep_alive.h"
#include "chrome/browser/ui/app_list/profile_store.h"
#include "chrome/browser/ui/user_manager.h"
+namespace {
+
+static const KeepAliveOptions g_keep_alive_options = {"ProfileLoader"};
+
+} // namespace
+
ProfileLoader::ProfileLoader(ProfileStore* profile_store)
: profile_store_(profile_store),
profile_load_sequence_id_(0),
@@ -66,7 +73,7 @@ void ProfileLoader::OnProfileLoaded(int profile_load_sequence_id,
void ProfileLoader::IncrementPendingProfileLoads() {
pending_profile_loads_++;
if (pending_profile_loads_ == 1)
- keep_alive_.reset(new ScopedKeepAlive);
+ keep_alive_.reset(new ScopedKeepAlive(&g_keep_alive_options));
}
void ProfileLoader::DecrementPendingProfileLoads() {

Powered by Google App Engine
This is Rietveld 408576698