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

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

Issue 803813003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « content/common/set_process_title.cc ('k') | 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 g_thread_safe_sender.Get() = thread_safe_sender(); 61 g_thread_safe_sender.Get() = thread_safe_sender();
62 } 62 }
63 63
64 GpuChildThread::GpuChildThread(const std::string& channel_id) 64 GpuChildThread::GpuChildThread(const std::string& channel_id)
65 : ChildThread(Options(channel_id, false)), 65 : ChildThread(Options(channel_id, false)),
66 dead_on_arrival_(false), 66 dead_on_arrival_(false),
67 in_browser_process_(true) { 67 in_browser_process_(true) {
68 #if defined(OS_WIN) 68 #if defined(OS_WIN)
69 target_services_ = NULL; 69 target_services_ = NULL;
70 #endif 70 #endif
71 DCHECK( 71 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
72 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || 72 switches::kSingleProcess) ||
73 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)); 73 base::CommandLine::ForCurrentProcess()->HasSwitch(
74 switches::kInProcessGPU));
74 #if !defined(OS_ANDROID) 75 #if !defined(OS_ANDROID)
75 // For single process and in-process GPU mode, we need to load and 76 // For single process and in-process GPU mode, we need to load and
76 // initialize the GL implementation and locate the GL entry points here. 77 // initialize the GL implementation and locate the GL entry points here.
77 // On Android, GLSurface::InitializeOneOff() is called from BrowserMainLoop 78 // On Android, GLSurface::InitializeOneOff() is called from BrowserMainLoop
78 // before getting here. crbug.com/326295 79 // before getting here. crbug.com/326295
79 if (!gfx::GLSurface::InitializeOneOff()) 80 if (!gfx::GLSurface::InitializeOneOff())
80 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; 81 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
81 #endif 82 #endif
82 g_thread_safe_sender.Get() = thread_safe_sender(); 83 g_thread_safe_sender.Get() = thread_safe_sender();
83 } 84 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void GpuChildThread::StopWatchdog() { 179 void GpuChildThread::StopWatchdog() {
179 if (watchdog_thread_.get()) { 180 if (watchdog_thread_.get()) {
180 watchdog_thread_->Stop(); 181 watchdog_thread_->Stop();
181 } 182 }
182 } 183 }
183 184
184 void GpuChildThread::OnCollectGraphicsInfo() { 185 void GpuChildThread::OnCollectGraphicsInfo() {
185 #if defined(OS_WIN) 186 #if defined(OS_WIN)
186 // GPU full info collection should only happen on un-sandboxed GPU process 187 // GPU full info collection should only happen on un-sandboxed GPU process
187 // or single process/in-process gpu mode on Windows. 188 // or single process/in-process gpu mode on Windows.
188 CommandLine* command_line = CommandLine::ForCurrentProcess(); 189 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
189 DCHECK(command_line->HasSwitch(switches::kDisableGpuSandbox) || 190 DCHECK(command_line->HasSwitch(switches::kDisableGpuSandbox) ||
190 in_browser_process_); 191 in_browser_process_);
191 #endif // OS_WIN 192 #endif // OS_WIN
192 193
193 gpu::CollectInfoResult result = 194 gpu::CollectInfoResult result =
194 gpu::CollectContextGraphicsInfo(&gpu_info_); 195 gpu::CollectContextGraphicsInfo(&gpu_info_);
195 switch (result) { 196 switch (result) {
196 case gpu::kCollectInfoFatalFailure: 197 case gpu::kCollectInfoFatalFailure:
197 LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal)."; 198 LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal).";
198 // TODO(piman): can we signal overall failure? 199 // TODO(piman): can we signal overall failure?
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 269 }
269 270
270 void GpuChildThread::OnGpuSwitched() { 271 void GpuChildThread::OnGpuSwitched() {
271 DVLOG(1) << "GPU: GPU has switched"; 272 DVLOG(1) << "GPU: GPU has switched";
272 // Notify observers in the GPU process. 273 // Notify observers in the GPU process.
273 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); 274 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched();
274 } 275 }
275 276
276 } // namespace content 277 } // namespace content
277 278
OLDNEW
« no previous file with comments | « content/common/set_process_title.cc ('k') | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698