Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: chrome/browser/gpu/gpu_feature_checker.cc

Issue 534043002: Add bits to indicate which parts of GPUInfo are collected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/browser/risk/fingerprint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gpu/gpu_feature_checker.h" 5 #include "chrome/browser/gpu/gpu_feature_checker.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/gpu_data_manager.h" 9 #include "content/public/browser/gpu_data_manager.h"
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 bool finalized = true; 35 bool finalized = true;
36 #if defined(OS_LINUX) 36 #if defined(OS_LINUX)
37 // On Windows and Mac, so far we can always make the final WebGL blacklisting 37 // On Windows and Mac, so far we can always make the final WebGL blacklisting
38 // decision based on partial GPU info; on Linux, we need to launch the GPU 38 // decision based on partial GPU info; on Linux, we need to launch the GPU
39 // process to collect full GPU info and make the final decision. 39 // process to collect full GPU info and make the final decision.
40 finalized = false; 40 finalized = false;
41 #endif 41 #endif
42 42
43 content::GpuDataManager* manager = content::GpuDataManager::GetInstance(); 43 content::GpuDataManager* manager = content::GpuDataManager::GetInstance();
44 if (manager->IsCompleteGpuInfoAvailable()) 44 if (manager->IsEssentialGpuInfoAvailable())
45 finalized = true; 45 finalized = true;
46 46
47 bool feature_allowed = IsFeatureAllowed(manager, feature_); 47 bool feature_allowed = IsFeatureAllowed(manager, feature_);
48 if (!feature_allowed) 48 if (!feature_allowed)
49 finalized = true; 49 finalized = true;
50 50
51 if (finalized) { 51 if (finalized) {
52 callback_.Run(feature_allowed); 52 callback_.Run(feature_allowed);
53 } else { 53 } else {
54 // Matched with a Release in OnGpuInfoUpdate. 54 // Matched with a Release in OnGpuInfoUpdate.
55 AddRef(); 55 AddRef();
56 56
57 manager->AddObserver(this); 57 manager->AddObserver(this);
58 manager->RequestCompleteGpuInfoIfNeeded(); 58 manager->RequestCompleteGpuInfoIfNeeded();
59 } 59 }
60 } 60 }
61 61
62 void GPUFeatureChecker::OnGpuInfoUpdate() { 62 void GPUFeatureChecker::OnGpuInfoUpdate() {
63 content::GpuDataManager* manager = content::GpuDataManager::GetInstance(); 63 content::GpuDataManager* manager = content::GpuDataManager::GetInstance();
64 manager->RemoveObserver(this); 64 manager->RemoveObserver(this);
65 bool feature_allowed = IsFeatureAllowed(manager, feature_); 65 bool feature_allowed = IsFeatureAllowed(manager, feature_);
66 callback_.Run(feature_allowed); 66 callback_.Run(feature_allowed);
67 67
68 // Matches the AddRef in HasFeature(). 68 // Matches the AddRef in HasFeature().
69 Release(); 69 Release();
70 } 70 }
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/browser/risk/fingerprint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698