| 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 11 matching lines...) Expand all Loading... |
| 22 // The options controlled by the PreRead field trial. | 22 // The options controlled by the PreRead field trial. |
| 23 struct PreReadOptions { | 23 struct PreReadOptions { |
| 24 // Pre-read DLLs explicitly. | 24 // Pre-read DLLs explicitly. |
| 25 bool pre_read : 1; | 25 bool pre_read : 1; |
| 26 | 26 |
| 27 // Pre-read DLLs with a high thread priority. | 27 // Pre-read DLLs with a high thread priority. |
| 28 bool high_priority : 1; | 28 bool high_priority : 1; |
| 29 | 29 |
| 30 // Pre-read DLLs using the ::PrefetchVirtualMemory function, if available. | 30 // Pre-read DLLs using the ::PrefetchVirtualMemory function, if available. |
| 31 bool prefetch_virtual_memory : 1; | 31 bool prefetch_virtual_memory : 1; |
| 32 | |
| 33 // Pre-read chrome_child.dll in the browser process and not in child | |
| 34 // processes. | |
| 35 bool pre_read_chrome_child_in_browser : 1; | |
| 36 }; | 32 }; |
| 37 | 33 |
| 38 // Initializes DLL pre-reading options from the registry. | 34 // Initializes DLL pre-reading options from the registry. |
| 39 // |product_registry_path| is the registry path under which the registry key for | 35 // |product_registry_path| is the registry path under which the registry key for |
| 40 // this field trial resides. | 36 // this field trial resides. |
| 41 void InitializePreReadOptions(const base::string16& product_registry_path); | 37 void InitializePreReadOptions(const base::string16& product_registry_path); |
| 42 | 38 |
| 43 // Returns the bitfield of the DLL pre-reading options to use for the current | 39 // Returns the bitfield of the DLL pre-reading options to use for the current |
| 44 // process. InitializePreReadOptions() must have been called before this. | 40 // process. InitializePreReadOptions() must have been called before this. |
| 45 PreReadOptions GetPreReadOptions(); | 41 PreReadOptions GetPreReadOptions(); |
| 46 | 42 |
| 47 // Updates DLL pre-reading options in the registry with the latest info for the | 43 // Updates DLL pre-reading options in the registry with the latest info for the |
| 48 // next startup. |product_registry_path| is the registry path under which the | 44 // next startup. |product_registry_path| is the registry path under which the |
| 49 // registry key for this field trial resides. | 45 // registry key for this field trial resides. |
| 50 void UpdatePreReadOptions(const base::string16& product_registry_path); | 46 void UpdatePreReadOptions(const base::string16& product_registry_path); |
| 51 | 47 |
| 52 // Registers a synthetic field trial with the PreRead group currently stored in | 48 // Registers a synthetic field trial with the PreRead group currently stored in |
| 53 // the registry. This must be done before the first metric log | 49 // the registry. This must be done before the first metric log |
| 54 // (metrics::MetricsLog) is created. Otherwise, UMA metrics generated during | 50 // (metrics::MetricsLog) is created. Otherwise, UMA metrics generated during |
| 55 // startup won't be correctly annotated. |product_registry_path| is the registry | 51 // startup won't be correctly annotated. |product_registry_path| is the registry |
| 56 // path under which the key for this field trial resides. | 52 // path under which the key for this field trial resides. |
| 57 void RegisterPreReadSyntheticFieldTrial( | 53 void RegisterPreReadSyntheticFieldTrial( |
| 58 const base::string16& product_registry_path, | 54 const base::string16& product_registry_path, |
| 59 const RegisterPreReadSyntheticFieldTrialCallback& | 55 const RegisterPreReadSyntheticFieldTrialCallback& |
| 60 register_synthetic_field_trial); | 56 register_synthetic_field_trial); |
| 61 | 57 |
| 62 } // namespace startup_metric_utils | 58 } // namespace startup_metric_utils |
| 63 | 59 |
| 64 #endif // COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN
_H_ | 60 #endif // COMPONENTS_STARTUP_METRIC_UTILS_COMMON_PRE_READ_FIELD_TRIAL_UTILS_WIN
_H_ |
| OLD | NEW |