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

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 review 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 OnVideoMemoryUsageStatsUpdate(
169 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats)
170 OVERRIDE {}
168 171
169 private: 172 private:
170 ComponentUpdateService* cus_; 173 ComponentUpdateService* cus_;
171 }; 174 };
172 175
173 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) 176 UpdateChecker::UpdateChecker(ComponentUpdateService* cus)
174 : cus_(cus) { 177 : cus_(cus) {
175 } 178 }
176 179
177 void UpdateChecker::OnGpuInfoUpdate() { 180 void UpdateChecker::OnGpuInfoUpdate() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { 230 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) {
228 #if defined(ENABLE_SWIFTSHADER) 231 #if defined(ENABLE_SWIFTSHADER)
229 base::CPU cpu; 232 base::CPU cpu;
230 233
231 if (!cpu.has_sse2()) 234 if (!cpu.has_sse2())
232 return; 235 return;
233 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 236 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
234 base::Bind(&RegisterSwiftShaderPath, cus)); 237 base::Bind(&RegisterSwiftShaderPath, cus));
235 #endif 238 #endif
236 } 239 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698