refactor: make util::Promise type safe when chaining in native (#19809)

* refactor: make util::Promise type safe when chaining in native

* fixup! refactor: make util::Promise type safe when chaining in native

* chore: remove spare brackets
This commit is contained in:
Samuel Attard 2019-08-22 17:03:28 -07:00 committed by GitHub
parent f7e3e1f97a
commit 6a3922d330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 275 additions and 343 deletions

View file

@ -25,8 +25,8 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
GPUInfoManager();
~GPUInfoManager() override;
bool NeedsCompleteGpuInfoCollection() const;
void FetchCompleteInfo(util::Promise promise);
void FetchBasicInfo(util::Promise promise);
void FetchCompleteInfo(util::Promise<base::DictionaryValue> promise);
void FetchBasicInfo(util::Promise<base::DictionaryValue> promise);
void OnGpuInfoUpdate() override;
private:
@ -34,12 +34,12 @@ class GPUInfoManager : public content::GpuDataManagerObserver {
gpu::GPUInfo gpu_info) const;
// These should be posted to the task queue
void CompleteInfoFetcher(util::Promise promise);
void CompleteInfoFetcher(util::Promise<base::DictionaryValue> promise);
void ProcessCompleteInfo();
// This set maintains all the promises that should be fulfilled
// once we have the complete information data
std::vector<util::Promise> complete_info_promise_set_;
std::vector<util::Promise<base::DictionaryValue>> complete_info_promise_set_;
content::GpuDataManager* gpu_data_manager_;
DISALLOW_COPY_AND_ASSIGN(GPUInfoManager);