Files
electron/shell/browser/api/gpu_info_enumerator.h
electron-roller[bot] ba135e2f7f chore: bump chromium to 144.0.7506.0 (main) (#48744)
* chore: bump chromium in DEPS to 144.0.7504.0

* chore: bump chromium in DEPS to 144.0.7506.0

* chore: update patches

* Revert "build: explicitly disable reclient"

This reverts commit e08c6adb08.

No longer needed after https://crrev.com/c/7099239

* 7097498: Remove MSG_ROUTING_* constants from ipc_message.h

https://chromium-review.googlesource.com/c/chromium/src/+/7097498

* 7090671: [//gpu] Remove unneeded GpuInfo methods

https://chromium-review.googlesource.com/c/chromium/src/+/7090671

* 7103701: Remove IPC::PlatformFileForTransit.

https://chromium-review.googlesource.com/c/chromium/src/+/7103701

(This should have been removed with https://github.com/electron/electron/pull/17406).

* chore: update filenames.libcxx.gni

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-11-03 21:26:16 -08:00

60 lines
2.1 KiB
C++

// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_API_GPU_INFO_ENUMERATOR_H_
#define ELECTRON_SHELL_BROWSER_API_GPU_INFO_ENUMERATOR_H_
#include <stack>
#include <string>
#include "base/values.h"
#include "gpu/config/gpu_info.h"
namespace electron {
// This class implements the enumerator for reading all the attributes in
// GPUInfo into a dictionary.
class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
const char* const kGPUDeviceKey = "gpuDevice";
const char* const kVideoDecodeAcceleratorSupportedProfileKey =
"videoDecodeAcceleratorSupportedProfile";
const char* const kVideoEncodeAcceleratorSupportedProfileKey =
"videoEncodeAcceleratorSupportedProfile";
const char* const kAuxAttributesKey = "auxAttributes";
const char* const kOverlayInfo = "overlayInfo";
public:
GPUInfoEnumerator();
~GPUInfoEnumerator() override;
// gpu::GPUInfo::Enumerator
void AddInt64(const char* name, int64_t value) override;
void AddInt(const char* name, int value) override;
void AddString(const char* name, const std::string& value) override;
void AddBool(const char* name, bool value) override;
void AddTimeDeltaInSecondsF(const char* name,
const base::TimeDelta& value) override;
void AddBinary(const char* name,
const base::span<const uint8_t>& value) override;
void BeginGPUDevice() override;
void EndGPUDevice() override;
void BeginVideoDecodeAcceleratorSupportedProfile() override;
void EndVideoDecodeAcceleratorSupportedProfile() override;
void BeginVideoEncodeAcceleratorSupportedProfile() override;
void EndVideoEncodeAcceleratorSupportedProfile() override;
void BeginAuxAttributes() override;
void EndAuxAttributes() override;
void BeginOverlayInfo() override;
void EndOverlayInfo() override;
base::Value::Dict GetDictionary();
private:
// The stack is used to manage nested values
std::stack<base::Value::Dict> value_stack_;
base::Value::Dict current_;
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_API_GPU_INFO_ENUMERATOR_H_