Bug 1686495 [wpt PR 27132] - Add tests for proposed WebDriver Shadow DOM support...
[gecko.git] / toolkit / xre / DllPrefetchExperimentRegistryInfo.h
blob26cba51dcf2304be7264b7134cb43e3a35d5bfc4
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_DllPrefetchExperimentRegistryInfo_h
8 #define mozilla_DllPrefetchExperimentRegistryInfo_h
10 #include "mozilla/Maybe.h"
11 #include "mozilla/WinHeaderOnlyUtils.h"
12 #include "nsWindowsHelpers.h"
14 /**
15 * This is a temporary file in order to conduct an experiment on the impact of
16 * startup time on retention (see Bug 1640087).
17 * This was generally adapted from LauncherRegistryInfo.h
20 namespace mozilla {
22 enum class AlteredDllPrefetchMode {
23 CurrentPrefetch,
24 NoPrefetch,
25 OptimizedPrefetch
28 class DllPrefetchExperimentRegistryInfo final {
29 public:
30 DllPrefetchExperimentRegistryInfo() : mBinPath(GetFullBinaryPath().get()) {}
31 ~DllPrefetchExperimentRegistryInfo() {}
33 Result<Ok, nsresult> ReflectPrefToRegistry(int32_t aVal);
34 Result<Ok, nsresult> ReadRegistryValueData(DWORD expectedType);
36 AlteredDllPrefetchMode GetAlteredDllPrefetchMode();
38 private:
39 Result<Ok, nsresult> Open();
41 nsAutoRegKey mRegKey;
42 nsString mBinPath;
43 int32_t mPrefetchMode;
45 static const wchar_t kExperimentSubKeyPath[];
48 } // namespace mozilla
50 #endif // mozilla_DllPrefetchExperimentRegistryInfo_h