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