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

Side by Side Diff: chrome/browser/component_updater/swiftshader_component_installer.cc

Issue 10854076: Add GPU memory tab to the task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate taskman feedback Created 8 years, 4 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 | Annotate | Revision Log
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/component_updater/swiftshader_component_installer.h" 5 #include "chrome/browser/component_updater/swiftshader_component_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/cpu.h" 10 #include "base/cpu.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { 158 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) {
159 NOTREACHED() << "SwiftShader component registration fail"; 159 NOTREACHED() << "SwiftShader component registration fail";
160 } 160 }
161 } 161 }
162 162
163 class UpdateChecker : public content::GpuDataManagerObserver { 163 class UpdateChecker : public content::GpuDataManagerObserver {
164 public: 164 public:
165 explicit UpdateChecker(ComponentUpdateService* cus); 165 explicit UpdateChecker(ComponentUpdateService* cus);
166 166
167 virtual void OnGpuInfoUpdate() OVERRIDE; 167 virtual void OnGpuInfoUpdate() OVERRIDE;
168 virtual void OnVidmemUsageStatsUpdate(
169 const content::GPUVidmemUsageStats& vidmem_usage_stats) OVERRIDE {}
168 170
169 private: 171 private:
170 ComponentUpdateService* cus_; 172 ComponentUpdateService* cus_;
171 }; 173 };
172 174
173 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) 175 UpdateChecker::UpdateChecker(ComponentUpdateService* cus)
174 : cus_(cus) { 176 : cus_(cus) {
175 } 177 }
176 178
177 void UpdateChecker::OnGpuInfoUpdate() { 179 void UpdateChecker::OnGpuInfoUpdate() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { 229 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) {
228 #if defined(ENABLE_SWIFTSHADER) 230 #if defined(ENABLE_SWIFTSHADER)
229 base::CPU cpu; 231 base::CPU cpu;
230 232
231 if (!cpu.has_sse2()) 233 if (!cpu.has_sse2())
232 return; 234 return;
233 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 235 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
234 base::Bind(&RegisterSwiftShaderPath, cus)); 236 base::Bind(&RegisterSwiftShaderPath, cus));
235 #endif 237 #endif
236 } 238 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698