chore: modernize ListValue usage in gpu info (#34663)

This commit is contained in:
Jeremy Rose 2022-06-28 09:52:59 -07:00 committed by GitHub
parent a4043237da
commit 07294cbf15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 76 deletions

View file

@ -28,22 +28,20 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
GPUInfoManager& operator=(const GPUInfoManager&) = delete;
bool NeedsCompleteGpuInfoCollection() const;
void FetchCompleteInfo(gin_helper::Promise<base::DictionaryValue> promise);
void FetchBasicInfo(gin_helper::Promise<base::DictionaryValue> promise);
void FetchCompleteInfo(gin_helper::Promise<base::Value> promise);
void FetchBasicInfo(gin_helper::Promise<base::Value> promise);
void OnGpuInfoUpdate() override;
private:
std::unique_ptr<base::DictionaryValue> EnumerateGPUInfo(
gpu::GPUInfo gpu_info) const;
base::Value::Dict EnumerateGPUInfo(gpu::GPUInfo gpu_info) const;
// These should be posted to the task queue
void CompleteInfoFetcher(gin_helper::Promise<base::DictionaryValue> promise);
void CompleteInfoFetcher(gin_helper::Promise<base::Value> promise);
void ProcessCompleteInfo();
// This set maintains all the promises that should be fulfilled
// once we have the complete information data
std::vector<gin_helper::Promise<base::DictionaryValue>>
complete_info_promise_set_;
std::vector<gin_helper::Promise<base::Value>> complete_info_promise_set_;
content::GpuDataManagerImpl* gpu_data_manager_;
};