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

Side by Side Diff: chrome/common/channel_info_win.cc

Issue 2799013002: Monitor crashpad_handler for crashes [sometimes] (Closed)
Patch Set: Address review feedback (scottmg) Created 3 years, 8 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/app/chrome_exe_main_win.cc ('k') | chrome/install_static/BUILD.gn » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/channel_info.h" 5 #include "chrome/common/channel_info.h"
6 6
7 #include "base/debug/profiler.h" 7 #include "base/debug/profiler.h"
8 #include "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/install_static/install_details.h" 11 #include "chrome/install_static/install_util.h"
12 #include "components/version_info/version_info.h"
13 12
14 namespace chrome { 13 namespace chrome {
15 14
16 std::string GetChannelString() { 15 std::string GetChannelString() {
17 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is 16 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is
18 // fixed. 17 // fixed.
19 tracked_objects::ScopedTracker tracking_profile( 18 tracked_objects::ScopedTracker tracking_profile(
20 FROM_HERE_WITH_EXPLICIT_FUNCTION( 19 FROM_HERE_WITH_EXPLICIT_FUNCTION(
21 "422460 VersionInfo::GetVersionStringModifier")); 20 "422460 VersionInfo::GetVersionStringModifier"));
22 21
23 #if defined(GOOGLE_CHROME_BUILD) 22 #if defined(GOOGLE_CHROME_BUILD)
24 base::string16 channel(install_static::InstallDetails::Get().channel()); 23 base::string16 channel(install_static::GetChromeChannelName());
25 #if defined(SYZYASAN) 24 #if defined(SYZYASAN)
26 if (base::debug::IsBinaryInstrumented()) 25 if (base::debug::IsBinaryInstrumented())
27 channel += L" SyzyASan"; 26 channel += L" SyzyASan";
28 #endif 27 #endif
29 return base::UTF16ToASCII(channel); 28 return base::UTF16ToASCII(channel);
30 #else 29 #else
31 return std::string(); 30 return std::string();
32 #endif 31 #endif
33 } 32 }
34 33
35 version_info::Channel GetChannel() { 34 version_info::Channel GetChannel() {
36 #if defined(GOOGLE_CHROME_BUILD) 35 return install_static::GetChromeChannel();
37 base::string16 channel(install_static::InstallDetails::Get().channel());
38
39 if (channel.empty()) {
40 return version_info::Channel::STABLE;
41 } else if (channel == L"beta") {
42 return version_info::Channel::BETA;
43 } else if (channel == L"dev") {
44 return version_info::Channel::DEV;
45 } else if (channel == L"canary") {
46 return version_info::Channel::CANARY;
47 }
48 #endif
49
50 return version_info::Channel::UNKNOWN;
51 } 36 }
52 37
53 } // namespace chrome 38 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/app/chrome_exe_main_win.cc ('k') | chrome/install_static/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698