| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 GpuChildThread::GpuChildThread(const std::string& channel_id) | 58 GpuChildThread::GpuChildThread(const std::string& channel_id) |
| 59 : ChildThread(channel_id), | 59 : ChildThread(channel_id), |
| 60 dead_on_arrival_(false), | 60 dead_on_arrival_(false), |
| 61 in_browser_process_(true) { | 61 in_browser_process_(true) { |
| 62 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
| 63 target_services_ = NULL; | 63 target_services_ = NULL; |
| 64 #endif | 64 #endif |
| 65 DCHECK( | 65 DCHECK( |
| 66 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || | 66 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || |
| 67 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)); | 67 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)); |
| 68 #if !defined(OS_ANDROID) | |
| 69 // For single process and in-process GPU mode, we need to load and | 68 // For single process and in-process GPU mode, we need to load and |
| 70 // initialize the GL implementation and locate the GL entry points here. | 69 // initialize the GL implementation and locate the GL entry points here. |
| 71 // On Android, GLSurface::InitializeOneOff() is called from BrowserMainLoop | 70 if (!gfx::GLSurface::InitializeOneOff()) { |
| 72 // before getting here. crbug.com/326295 | 71 VLOG(1) << "gfx::GLSurface::InitializeOneOff()"; |
| 73 if (!gfx::GLSurface::InitializeOneOff()) | 72 } |
| 74 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; | |
| 75 #endif | |
| 76 g_thread_safe_sender.Get() = thread_safe_sender(); | 73 g_thread_safe_sender.Get() = thread_safe_sender(); |
| 77 } | 74 } |
| 78 | 75 |
| 79 GpuChildThread::~GpuChildThread() { | 76 GpuChildThread::~GpuChildThread() { |
| 80 } | 77 } |
| 81 | 78 |
| 82 void GpuChildThread::Shutdown() { | 79 void GpuChildThread::Shutdown() { |
| 83 ChildThread::Shutdown(); | 80 ChildThread::Shutdown(); |
| 84 logging::SetLogMessageHandler(NULL); | 81 logging::SetLogMessageHandler(NULL); |
| 85 } | 82 } |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // the future posting of tasks to the message loop. | 231 // the future posting of tasks to the message loop. |
| 235 if (watchdog_thread_->message_loop()) | 232 if (watchdog_thread_->message_loop()) |
| 236 watchdog_thread_->PostAcknowledge(); | 233 watchdog_thread_->PostAcknowledge(); |
| 237 // Prevent rearming. | 234 // Prevent rearming. |
| 238 watchdog_thread_->Stop(); | 235 watchdog_thread_->Stop(); |
| 239 } | 236 } |
| 240 } | 237 } |
| 241 | 238 |
| 242 } // namespace content | 239 } // namespace content |
| 243 | 240 |
| OLD | NEW |