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

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 1778873002: Replace Increment/DecrementKeepAliveCount by ScopedKeepAlives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KAObserver
Patch Set: replace the commented dcheck by a dlog Created 4 years, 9 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 | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel.cc
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index ca0541f4d724d8bba9df84dcaf8550a3d1b37587..04f818256b6244426bc21566db29ccb2ebb15bd0 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -21,6 +21,8 @@
#include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/extensions/window_controller_list.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/lifetime/keep_alive_types.h"
+#include "chrome/browser/lifetime/scoped_keep_alive.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/task_management/web_contents_tags.h"
@@ -166,10 +168,6 @@ bool PanelExtensionWindowController::IsVisibleToExtension(
Panel::~Panel() {
DCHECK(!collection_);
-#if !defined(USE_AURA)
- // Invoked by native panel destructor. Do not access native_panel_ here.
- chrome::DecrementKeepAliveCount(); // Remove shutdown prevention.
-#endif
}
PanelManager* Panel::manager() const {
@@ -558,10 +556,13 @@ void Panel::Initialize(const GURL& url,
content::Source<ThemeService>(
ThemeServiceFactory::GetForProfile(profile_)));
+// TODO(dgn): Should keep_alive be always registered regardless of the platform
+// here? (https://crbug.com/590173)
#if !defined(USE_AURA)
// Keep alive for AURA has been moved to panel_view.
// Prevent the browser process from shutting down while this window is open.
- chrome::IncrementKeepAliveCount();
+ keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::PANEL,
+ KeepAliveRestartOption::DISABLED));
#endif
UpdateAppIcon();
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698