blob: aea620d77a52b109738b7fd33d1202949ea5440d [file]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_UPDATER_WIN_WRL_MODULE_INITIALIZER_H_
#define CHROME_UPDATER_WIN_WRL_MODULE_INITIALIZER_H_
#include <wrl/module.h>
namespace updater {
// Allows one time creation of the WRL::Module instance. The WRL library
// contains a global instance of a class, which must be created only once.
class WRLModuleInitializer {
public:
WRLModuleInitializer() {
Microsoft::WRL::Module<Microsoft::WRL::OutOfProc>::GetModule();
}
static const WRLModuleInitializer& Get() {
static const WRLModuleInitializer module;
return module;
}
};
} // namespace updater
#endif // CHROME_UPDATER_WIN_WRL_MODULE_INITIALIZER_H_