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

Side by Side Diff: chrome/browser/lifetime/keep_alive_types.cc

Issue 1803143002: Replace BrowserProces::AddRefModule/RemoveModule by ScopedKeepAlive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/lifetime/keep_alive_types.h ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/lifetime/keep_alive_types.h" 5 #include "chrome/browser/lifetime/keep_alive_types.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 #ifndef NDEBUG 8 #ifndef NDEBUG
9 std::ostream& operator<<(std::ostream& out, const KeepAliveOrigin& origin) { 9 std::ostream& operator<<(std::ostream& out, const KeepAliveOrigin& origin) {
10 switch (origin) { 10 switch (origin) {
11 case KeepAliveOrigin::APP_CONTROLLER: 11 case KeepAliveOrigin::APP_CONTROLLER:
12 return out << "APP_CONTROLLER"; 12 return out << "APP_CONTROLLER";
13 case KeepAliveOrigin::BROWSER:
14 return out << "BROWSER";
13 case KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS: 15 case KeepAliveOrigin::BROWSER_PROCESS_CHROMEOS:
14 return out << "BROWSER_PROCESS_CHROMEOS"; 16 return out << "BROWSER_PROCESS_CHROMEOS";
17 case KeepAliveOrigin::SESSION_RESTORE:
18 return out << "SESSION_RESTORE";
15 case KeepAliveOrigin::BACKGROUND_MODE_MANAGER: 19 case KeepAliveOrigin::BACKGROUND_MODE_MANAGER:
16 return out << "BACKGROUND_MODE_MANAGER"; 20 return out << "BACKGROUND_MODE_MANAGER";
17 case KeepAliveOrigin::BACKGROUND_MODE_MANAGER_STARTUP: 21 case KeepAliveOrigin::BACKGROUND_MODE_MANAGER_STARTUP:
18 return out << "BACKGROUND_MODE_MANAGER_STARTUP"; 22 return out << "BACKGROUND_MODE_MANAGER_STARTUP";
19 case KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL: 23 case KeepAliveOrigin::LOGIN_DISPLAY_HOST_IMPL:
20 return out << "LOGIN_DISPLAY_HOST_IMPL"; 24 return out << "LOGIN_DISPLAY_HOST_IMPL";
21 case KeepAliveOrigin::APP_LIST_SERVICE_VIEWS: 25 case KeepAliveOrigin::APP_LIST_SERVICE_VIEWS:
22 return out << "APP_LIST_SERVICE_VIEWS"; 26 return out << "APP_LIST_SERVICE_VIEWS";
23 case KeepAliveOrigin::APP_LIST_SHOWER: 27 case KeepAliveOrigin::APP_LIST_SHOWER:
24 return out << "APP_LIST_SHOWER"; 28 return out << "APP_LIST_SHOWER";
25 case KeepAliveOrigin::CHROME_APP_DELEGATE: 29 case KeepAliveOrigin::CHROME_APP_DELEGATE:
26 return out << "CHROME_APP_DELEGATE"; 30 return out << "CHROME_APP_DELEGATE";
31 case KeepAliveOrigin::CHROME_VIEWS_DELEGATE:
32 return out << "CHROME_VIEWS_DELEGATE";
33 case KeepAliveOrigin::LEAKED_UNINSTALL_VIEW:
34 return out << "LEAKED_UNINSTALL_VIEW";
27 case KeepAliveOrigin::PANEL: 35 case KeepAliveOrigin::PANEL:
28 return out << "PANEL"; 36 return out << "PANEL";
29 case KeepAliveOrigin::PANEL_VIEW: 37 case KeepAliveOrigin::PANEL_VIEW:
30 return out << "PANEL_VIEW"; 38 return out << "PANEL_VIEW";
31 case KeepAliveOrigin::PROFILE_LOADER: 39 case KeepAliveOrigin::PROFILE_LOADER:
32 return out << "PROFILE_LOADER"; 40 return out << "PROFILE_LOADER";
33 case KeepAliveOrigin::USER_MANAGER_VIEW: 41 case KeepAliveOrigin::USER_MANAGER_VIEW:
34 return out << "USER_MANAGER_VIEW"; 42 return out << "USER_MANAGER_VIEW";
35 } 43 }
36 44
37 NOTREACHED(); 45 NOTREACHED();
38 return out << static_cast<int>(origin); 46 return out << static_cast<int>(origin);
39 } 47 }
40 48
41 std::ostream& operator<<(std::ostream& out, 49 std::ostream& operator<<(std::ostream& out,
42 const KeepAliveRestartOption& restart) { 50 const KeepAliveRestartOption& restart) {
43 switch (restart) { 51 switch (restart) {
44 case KeepAliveRestartOption::DISABLED: 52 case KeepAliveRestartOption::DISABLED:
45 return out << "DISABLED"; 53 return out << "DISABLED";
46 case KeepAliveRestartOption::ENABLED: 54 case KeepAliveRestartOption::ENABLED:
47 return out << "ENABLED"; 55 return out << "ENABLED";
48 } 56 }
49 57
50 NOTREACHED(); 58 NOTREACHED();
51 return out << static_cast<int>(restart); 59 return out << static_cast<int>(restart);
52 } 60 }
53 61
54 #endif // ndef NDEBUG 62 #endif // ndef NDEBUG
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/keep_alive_types.h ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698