electron_gpu_client.cc 596 B

12345678910111213141516171819202122232425
  1. // Copyright (c) 2019 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "shell/browser/electron_gpu_client.h"
  5. #include "base/environment.h"
  6. #if BUILDFLAG(IS_WIN)
  7. #include <windows.h>
  8. #endif
  9. namespace electron {
  10. ElectronGpuClient::ElectronGpuClient() = default;
  11. void ElectronGpuClient::PreCreateMessageLoop() {
  12. #if BUILDFLAG(IS_WIN)
  13. auto env = base::Environment::Create();
  14. if (env->HasVar("ELECTRON_DEFAULT_ERROR_MODE"))
  15. SetErrorMode(GetErrorMode() & ~SEM_NOGPFAULTERRORBOX);
  16. #endif
  17. }
  18. } // namespace electron