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

Side by Side Diff: components/startup_metric_utils/common/pre_read_field_trial_utils_win.h

Issue 2280183002: Remove all code related to the PreRead field trial. (Closed)
Patch Set: fix include Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN_H_
6 #define COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "base/strings/string16.h"
12
13 // Utility functions to support the PreRead field trial. The PreRead field trial
14 // changes the way DLLs are pre-read during startup.
15
16 namespace startup_metric_utils {
17
18 // Callback to register a synthetic field trial.
19 using RegisterPreReadSyntheticFieldTrialCallback =
20 const base::Callback<bool(const std::string&, const std::string&)>;
21
22 // The options controlled by the PreRead field trial.
23 struct PreReadOptions {
24 // Pre-read DLLs explicitly.
25 bool pre_read : 1;
26
27 // Pre-read DLLs with a high thread priority.
28 bool high_priority : 1;
29
30 // Pre-read DLLs using the ::PrefetchVirtualMemory function, if available.
31 bool prefetch_virtual_memory : 1;
32 };
33
34 // Initializes DLL pre-reading options from the registry.
35 // |product_registry_path| is the registry path under which the registry key for
36 // this field trial resides.
37 void InitializePreReadOptions(const base::string16& product_registry_path);
38
39 // Returns the bitfield of the DLL pre-reading options to use for the current
40 // process. InitializePreReadOptions() must have been called before this.
41 PreReadOptions GetPreReadOptions();
42
43 // Updates DLL pre-reading options in the registry with the latest info for the
44 // next startup. |product_registry_path| is the registry path under which the
45 // registry key for this field trial resides.
46 void UpdatePreReadOptions(const base::string16& product_registry_path);
47
48 // Registers a synthetic field trial with the PreRead group currently stored in
49 // the registry. This must be done before the first metric log
50 // (metrics::MetricsLog) is created. Otherwise, UMA metrics generated during
51 // startup won't be correctly annotated. |product_registry_path| is the registry
52 // path under which the key for this field trial resides.
53 void RegisterPreReadSyntheticFieldTrial(
54 const base::string16& product_registry_path,
55 const RegisterPreReadSyntheticFieldTrialCallback&
56 register_synthetic_field_trial);
57
58 } // namespace startup_metric_utils
59
60 #endif // COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN _H_
OLDNEW
« no previous file with comments | « components/startup_metric_utils/common/DEPS ('k') | components/startup_metric_utils/common/pre_read_field_trial_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698