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

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

Issue 401913002: Revert of Experimentally disable termination on heap corrruption in order to measure the contribution of this… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h"
6
7 #include "base/metrics/field_trial.h"
8 #include "base/win/registry.h"
9 #include "chrome/common/chrome_constants.h"
10 #include "chrome/common/chrome_version_info.h"
11
12 #if defined(OS_WIN)
13 #if defined(GOOGLE_CHROME_BUILD)
14 #define PRODUCT_STRING_PATH L"Google\\Chrome"
15 #elif defined(CHROMIUM_BUILD)
16 #define PRODUCT_STRING_PATH L"Chromium"
17 #else
18 #error Unknown branding
19 #endif
20 #endif // defined(OS_WIN)
21
22 namespace {
23
24 wchar_t* GetBeaconKeyPath() {
25 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
26 if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
27 return L"SOFTWARE\\" PRODUCT_STRING_PATH
28 L"\\DisableTerminateOnProcessHeapCorruptionSxs";
29 }
30 return L"SOFTWARE\\" PRODUCT_STRING_PATH
31 L"\\DisableTerminateOnProcessHeapCorruption";
32 }
33
34 } // namespace
35
36 bool ShouldExperimentallyDisableTerminateOnHeapCorruption() {
37 base::win::RegKey regkey(
38 HKEY_CURRENT_USER, GetBeaconKeyPath(), KEY_QUERY_VALUE);
39 return regkey.Valid();
40 }
41
42 void InitializeDisableTerminateOnHeapCorruptionExperiment() {
43 base::win::RegKey regkey(HKEY_CURRENT_USER);
44
45 if (base::FieldTrialList::FindFullName("TerminateOnProcessHeapCorruption") ==
46 "Disabled") {
47 regkey.CreateKey(GetBeaconKeyPath(), KEY_SET_VALUE);
48 } else {
49 regkey.DeleteKey(GetBeaconKeyPath());
50 }
51 }
OLDNEW
« no previous file with comments | « chrome/common/terminate_on_heap_corruption_experiment_win.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698