| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN_H_ | 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_ | 6 #define COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Pre-read DLLs with a high thread priority. | 27 // Pre-read DLLs with a high thread priority. |
| 28 PRE_READ_OPTION_HIGH_PRIORITY = 1 << 1, | 28 PRE_READ_OPTION_HIGH_PRIORITY = 1 << 1, |
| 29 | 29 |
| 30 // Pre-read DLLs only when they are cold. | 30 // Pre-read DLLs only when they are cold. |
| 31 PRE_READ_OPTION_ONLY_IF_COLD = 1 << 2, | 31 PRE_READ_OPTION_ONLY_IF_COLD = 1 << 2, |
| 32 | 32 |
| 33 // Pre-read DLLs using the ::PrefetchVirtualMemory function, if available. | 33 // Pre-read DLLs using the ::PrefetchVirtualMemory function, if available. |
| 34 PRE_READ_OPTION_PREFETCH_VIRTUAL_MEMORY = 1 << 3, | 34 PRE_READ_OPTION_PREFETCH_VIRTUAL_MEMORY = 1 << 3, |
| 35 | 35 |
| 36 // Don't use a /prefetch argument when launching a process. |
| 37 PRE_READ_OPTION_NO_PREFETCH_ARGUMENT = 1 << 4, |
| 38 |
| 36 // Set when the pre-read options have not been initialized yet. | 39 // Set when the pre-read options have not been initialized yet. |
| 37 PRE_READ_OPTION_UNINITIALIZED = 1 << 4, | 40 PRE_READ_OPTION_UNINITIALIZED = 1 << 5, |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 // Initializes DLL pre-reading options from the registry. | 43 // Initializes DLL pre-reading options from the registry. |
| 41 // |product_registry_path| is the registry path under which the registry key for | 44 // |product_registry_path| is the registry path under which the registry key for |
| 42 // this field trial resides. | 45 // this field trial resides. |
| 43 void InitializePreReadOptions(const base::string16& product_registry_path); | 46 void InitializePreReadOptions(const base::string16& product_registry_path); |
| 44 | 47 |
| 45 // Returns the bitfield of the DLL pre-reading options to use for the current | 48 // Returns the bitfield of the DLL pre-reading options to use for the current |
| 46 // process. InitializePreReadOptions() must have been called before this. | 49 // process. InitializePreReadOptions() must have been called before this. |
| 47 int GetPreReadOptions(); | 50 int GetPreReadOptions(); |
| 48 | 51 |
| 49 // Updates DLL pre-reading options in the registry with the latest info for the | 52 // Updates DLL pre-reading options in the registry with the latest info for the |
| 50 // next startup. |product_registry_path| is the registry path under which the | 53 // next startup. |product_registry_path| is the registry path under which the |
| 51 // registry key for this field trial resides. | 54 // registry key for this field trial resides. |
| 52 void UpdatePreReadOptions(const base::string16& product_registry_path); | 55 void UpdatePreReadOptions(const base::string16& product_registry_path); |
| 53 | 56 |
| 54 // Registers a synthetic field trial with the PreRead group currently stored in | 57 // Registers a synthetic field trial with the PreRead group currently stored in |
| 55 // the registry. This must be done before the first metric log | 58 // the registry. This must be done before the first metric log |
| 56 // (metrics::MetricsLog) is created. Otherwise, UMA metrics generated during | 59 // (metrics::MetricsLog) is created. Otherwise, UMA metrics generated during |
| 57 // startup won't be correctly annotated. |product_registry_path| is the registry | 60 // startup won't be correctly annotated. |product_registry_path| is the registry |
| 58 // path under which the key for this field trial resides. | 61 // path under which the key for this field trial resides. |
| 59 void RegisterPreReadSyntheticFieldTrial( | 62 void RegisterPreReadSyntheticFieldTrial( |
| 60 const base::string16& product_registry_path, | 63 const base::string16& product_registry_path, |
| 61 const RegisterPreReadSyntheticFieldTrialCallback& | 64 const RegisterPreReadSyntheticFieldTrialCallback& |
| 62 register_synthetic_field_trial); | 65 register_synthetic_field_trial); |
| 63 | 66 |
| 64 } // namespace startup_metric_utils | 67 } // namespace startup_metric_utils |
| 65 | 68 |
| 66 #endif // COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN
_H_ | 69 #endif // COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN
_H_ |
| OLD | NEW |