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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 715273002: [content/gpu] Convert VLOGs to DVLOGs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments Created 6 years, 1 month 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 | content/gpu/gpu_main.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 "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/worker_pool.h" 9 #include "base/threading/worker_pool.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 #endif // OS_WIN 191 #endif // OS_WIN
192 192
193 gpu::CollectInfoResult result = 193 gpu::CollectInfoResult result =
194 gpu::CollectContextGraphicsInfo(&gpu_info_); 194 gpu::CollectContextGraphicsInfo(&gpu_info_);
195 switch (result) { 195 switch (result) {
196 case gpu::kCollectInfoFatalFailure: 196 case gpu::kCollectInfoFatalFailure:
197 LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal)."; 197 LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal).";
198 // TODO(piman): can we signal overall failure? 198 // TODO(piman): can we signal overall failure?
199 break; 199 break;
200 case gpu::kCollectInfoNonFatalFailure: 200 case gpu::kCollectInfoNonFatalFailure:
201 VLOG(1) << "gpu::CollectGraphicsInfo failed (non-fatal)."; 201 DVLOG(1) << "gpu::CollectGraphicsInfo failed (non-fatal).";
202 break; 202 break;
203 case gpu::kCollectInfoNone: 203 case gpu::kCollectInfoNone:
204 NOTREACHED(); 204 NOTREACHED();
205 break; 205 break;
206 case gpu::kCollectInfoSuccess: 206 case gpu::kCollectInfoSuccess:
207 break; 207 break;
208 } 208 }
209 GetContentClient()->SetGpuInfo(gpu_info_); 209 GetContentClient()->SetGpuInfo(gpu_info_);
210 210
211 #if defined(OS_WIN) 211 #if defined(OS_WIN)
(...skipping 16 matching lines...) Expand all
228 228
229 void GpuChildThread::OnGetVideoMemoryUsageStats() { 229 void GpuChildThread::OnGetVideoMemoryUsageStats() {
230 GPUVideoMemoryUsageStats video_memory_usage_stats; 230 GPUVideoMemoryUsageStats video_memory_usage_stats;
231 if (gpu_channel_manager_) 231 if (gpu_channel_manager_)
232 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats( 232 gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats(
233 &video_memory_usage_stats); 233 &video_memory_usage_stats);
234 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats)); 234 Send(new GpuHostMsg_VideoMemoryUsageStats(video_memory_usage_stats));
235 } 235 }
236 236
237 void GpuChildThread::OnClean() { 237 void GpuChildThread::OnClean() {
238 VLOG(1) << "GPU: Removing all contexts"; 238 DVLOG(1) << "GPU: Removing all contexts";
239 if (gpu_channel_manager_) 239 if (gpu_channel_manager_)
240 gpu_channel_manager_->LoseAllContexts(); 240 gpu_channel_manager_->LoseAllContexts();
241 } 241 }
242 242
243 void GpuChildThread::OnCrash() { 243 void GpuChildThread::OnCrash() {
244 VLOG(1) << "GPU: Simulating GPU crash"; 244 DVLOG(1) << "GPU: Simulating GPU crash";
245 // Good bye, cruel world. 245 // Good bye, cruel world.
246 volatile int* it_s_the_end_of_the_world_as_we_know_it = NULL; 246 volatile int* it_s_the_end_of_the_world_as_we_know_it = NULL;
247 *it_s_the_end_of_the_world_as_we_know_it = 0xdead; 247 *it_s_the_end_of_the_world_as_we_know_it = 0xdead;
248 } 248 }
249 249
250 void GpuChildThread::OnHang() { 250 void GpuChildThread::OnHang() {
251 VLOG(1) << "GPU: Simulating GPU hang"; 251 DVLOG(1) << "GPU: Simulating GPU hang";
252 for (;;) { 252 for (;;) {
253 // Do not sleep here. The GPU watchdog timer tracks the amount of user 253 // Do not sleep here. The GPU watchdog timer tracks the amount of user
254 // time this thread is using and it doesn't use much while calling Sleep. 254 // time this thread is using and it doesn't use much while calling Sleep.
255 } 255 }
256 } 256 }
257 257
258 void GpuChildThread::OnDisableWatchdog() { 258 void GpuChildThread::OnDisableWatchdog() {
259 VLOG(1) << "GPU: Disabling watchdog thread"; 259 DVLOG(1) << "GPU: Disabling watchdog thread";
260 if (watchdog_thread_.get()) { 260 if (watchdog_thread_.get()) {
261 // Disarm the watchdog before shutting down the message loop. This prevents 261 // Disarm the watchdog before shutting down the message loop. This prevents
262 // the future posting of tasks to the message loop. 262 // the future posting of tasks to the message loop.
263 if (watchdog_thread_->message_loop()) 263 if (watchdog_thread_->message_loop())
264 watchdog_thread_->PostAcknowledge(); 264 watchdog_thread_->PostAcknowledge();
265 // Prevent rearming. 265 // Prevent rearming.
266 watchdog_thread_->Stop(); 266 watchdog_thread_->Stop();
267 } 267 }
268 } 268 }
269 269
270 void GpuChildThread::OnGpuSwitched() { 270 void GpuChildThread::OnGpuSwitched() {
271 VLOG(1) << "GPU: GPU has switched"; 271 DVLOG(1) << "GPU: GPU has switched";
272 // Notify observers in the GPU process. 272 // Notify observers in the GPU process.
273 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); 273 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
274 } 274 }
275 275
276 } // namespace content 276 } // namespace content
277 277
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698