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

Side by Side Diff: chromecast/crash/app_state_tracker.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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 | « chromecast/common/media/cast_media_client.h ('k') | chromecast/graphics/cast_vsync_settings.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/crash/app_state_tracker.h" 5 #include "chromecast/crash/app_state_tracker.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chromecast/crash/cast_crash_keys.h" 8 #include "chromecast/crash/cast_crash_keys.h"
9 9
10 namespace { 10 namespace {
11 11
12 struct CurrentAppState { 12 struct CurrentAppState {
13 std::string previous_app; 13 std::string previous_app;
14 std::string current_app; 14 std::string current_app;
15 std::string last_launched_app; 15 std::string last_launched_app;
16 }; 16 };
17 17
18 base::LazyInstance<CurrentAppState> g_app_state = LAZY_INSTANCE_INITIALIZER; 18 base::LazyInstance<CurrentAppState>::DestructorAtExit g_app_state =
19 LAZY_INSTANCE_INITIALIZER;
19 20
20 CurrentAppState* GetAppState() { 21 CurrentAppState* GetAppState() {
21 return g_app_state.Pointer(); 22 return g_app_state.Pointer();
22 } 23 }
23 24
24 } // namespace 25 } // namespace
25 26
26 namespace chromecast { 27 namespace chromecast {
27 28
28 // static 29 // static
(...skipping 25 matching lines...) Expand all
54 CurrentAppState* app_state = GetAppState(); 55 CurrentAppState* app_state = GetAppState();
55 app_state->previous_app = app_state->current_app; 56 app_state->previous_app = app_state->current_app;
56 app_state->current_app = app_id; 57 app_state->current_app = app_id;
57 58
58 base::debug::SetCrashKeyValue(crash_keys::kCurrentApp, app_id); 59 base::debug::SetCrashKeyValue(crash_keys::kCurrentApp, app_id);
59 base::debug::SetCrashKeyValue(crash_keys::kPreviousApp, 60 base::debug::SetCrashKeyValue(crash_keys::kPreviousApp,
60 app_state->previous_app); 61 app_state->previous_app);
61 } 62 }
62 63
63 } // namespace chromecast 64 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/common/media/cast_media_client.h ('k') | chromecast/graphics/cast_vsync_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698