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

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

Issue 402723002: 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 namespace {
13
14 wchar_t* GetBeaconKeyPath() {
15 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
16 if (channel == chrome::VersionInfo::CHANNEL_CANARY) {
17 return L"SOFTWARE\\" PRODUCT_STRING_PATH
18 L"\\DisableTerminateOnProcessHeapCorruptionSxs";
19 }
20 return L"SOFTWARE\\" PRODUCT_STRING_PATH
21 L"\\DisableTerminateOnProcessHeapCorruption";
22 }
23
24 } // namespace
25
26 bool ShouldExperimentallyDisableTerminateOnHeapCorruption() {
27 base::win::RegKey regkey(
28 HKEY_CURRENT_USER, GetBeaconKeyPath(), KEY_QUERY_VALUE);
29 return regkey.Valid();
30 }
31
32 void InitializeDisableTerminateOnHeapCorruptionExperiment() {
33 base::win::RegKey regkey(HKEY_CURRENT_USER);
34
35 if (base::FieldTrialList::FindFullName("TerminateOnProcessHeapCorruption") ==
36 "Disabled") {
37 regkey.CreateKey(GetBeaconKeyPath());
38 } else {
39 regkey.DeleteKey(GetBeaconKeyPath());
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698