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

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

Issue 558713002: Make PRODUCT_STRING_PATH accessible via chrome_constants.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean_exit_beacon
Patch Set: Rebase. Created 6 years, 3 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/common/chrome_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/terminate_on_heap_corruption_experiment_win.h" 5 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/win/registry.h" 9 #include "base/win/registry.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
11 #include "chrome/common/chrome_version_info.h" 11 #include "chrome/common/chrome_version_info.h"
12 12
13 #if defined(OS_WIN)
14 #if defined(GOOGLE_CHROME_BUILD)
15 #define PRODUCT_STRING_PATH L"Google\\Chrome"
16 #elif defined(CHROMIUM_BUILD)
17 #define PRODUCT_STRING_PATH L"Chromium"
18 #else
19 #error Unknown branding
20 #endif
21 #endif // defined(OS_WIN)
22
23 namespace { 13 namespace {
24 14
25 const wchar_t* GetBeaconKeyPath() { 15 const wchar_t* GetBeaconKeyPath() {
26 chrome::VersionInfo::Channel channel = chrome::VersionInfo::CHANNEL_UNKNOWN; 16 chrome::VersionInfo::Channel channel = chrome::VersionInfo::CHANNEL_UNKNOWN;
27 17
28 // We are called quite early, before the CommandLine is initialized. We don't 18 // We are called quite early, before the CommandLine is initialized. We don't
29 // want to permanently initialize it because ContentMainRunner::Initialize 19 // want to permanently initialize it because ContentMainRunner::Initialize
30 // sets some locale-related stuff to make sure it is parsed properly. But we 20 // sets some locale-related stuff to make sure it is parsed properly. But we
31 // can temporarily initialize it for the purpose of determining if we are 21 // can temporarily initialize it for the purpose of determining if we are
32 // Canary. 22 // Canary.
(...skipping 24 matching lines...) Expand all
57 void InitializeDisableTerminateOnHeapCorruptionExperiment() { 47 void InitializeDisableTerminateOnHeapCorruptionExperiment() {
58 base::win::RegKey regkey(HKEY_CURRENT_USER); 48 base::win::RegKey regkey(HKEY_CURRENT_USER);
59 49
60 if (base::FieldTrialList::FindFullName("TerminateOnProcessHeapCorruption") == 50 if (base::FieldTrialList::FindFullName("TerminateOnProcessHeapCorruption") ==
61 "Disabled") { 51 "Disabled") {
62 regkey.CreateKey(GetBeaconKeyPath(), KEY_SET_VALUE); 52 regkey.CreateKey(GetBeaconKeyPath(), KEY_SET_VALUE);
63 } else { 53 } else {
64 regkey.DeleteKey(GetBeaconKeyPath()); 54 regkey.DeleteKey(GetBeaconKeyPath());
65 } 55 }
66 } 56 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698