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

Unified Diff: chrome/browser/lifetime/keep_alive_types.cc

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a map and counts 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/lifetime/keep_alive_types.cc
diff --git a/chrome/browser/lifetime/keep_alive_types.cc b/chrome/browser/lifetime/keep_alive_types.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ff49a7627784c8d14a70b5d7018f4a0b96a629f6
--- /dev/null
+++ b/chrome/browser/lifetime/keep_alive_types.cc
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/lifetime/keep_alive_types.h"
+#include "base/logging.h"
+
+#ifndef NDEBUG
+std::ostream& operator<<(std::ostream& out, const KeepAliveOrigin& origin) {
+ switch (origin) {
+ case KeepAliveOrigin::TEST:
+ return out << "TEST";
+ case KeepAliveOrigin::BACKGROUND_MODE_MANAGER:
+ return out << "BACKGROUND_MODE_MANAGER";
+ case KeepAliveOrigin::APP_LIST_SERVICE_VIEWS:
+ return out << "APP_LIST_SERVICE_VIEWS";
+ case KeepAliveOrigin::APP_LIST_SHOWER:
+ return out << "APP_LIST_SHOWER";
+ case KeepAliveOrigin::CHROME_APP_DELEGATE:
+ return out << "CHROME_APP_DELEGATE";
+ case KeepAliveOrigin::PANEL_VIEW:
+ return out << "PANEL_VIEW";
+ case KeepAliveOrigin::PROFILE_LOADER:
+ return out << "PROFILE_LOADER";
+ case KeepAliveOrigin::USER_MANAGER_VIEW:
+ return out << "USER_MANAGER_VIEW";
+ }
+
+ NOTREACHED();
+ return out << static_cast<int>(origin);
+}
+#endif // ndef DEBUG

Powered by Google App Engine
This is Rietveld 408576698