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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 deferred_messages_(deferred_messages), | 70 deferred_messages_(deferred_messages), |
71 in_browser_process_(false) { | 71 in_browser_process_(false) { |
72 watchdog_thread_ = watchdog_thread; | 72 watchdog_thread_ = watchdog_thread; |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 target_services_ = NULL; | 74 target_services_ = NULL; |
75 #endif | 75 #endif |
76 g_thread_safe_sender.Get() = thread_safe_sender(); | 76 g_thread_safe_sender.Get() = thread_safe_sender(); |
77 } | 77 } |
78 | 78 |
79 GpuChildThread::GpuChildThread(const std::string& channel_id) | 79 GpuChildThread::GpuChildThread(const std::string& channel_id) |
80 : ChildThreadImpl(Options(channel_id, false)), | 80 : ChildThreadImpl(Options::Builder() |
| 81 .InBrowserProcess(true) |
| 82 .WithChannelName(channel_id) |
| 83 .Build()), |
81 dead_on_arrival_(false), | 84 dead_on_arrival_(false), |
82 in_browser_process_(true) { | 85 in_browser_process_(true) { |
83 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
84 target_services_ = NULL; | 87 target_services_ = NULL; |
85 #endif | 88 #endif |
86 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 89 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
87 switches::kSingleProcess) || | 90 switches::kSingleProcess) || |
88 base::CommandLine::ForCurrentProcess()->HasSwitch( | 91 base::CommandLine::ForCurrentProcess()->HasSwitch( |
89 switches::kInProcessGPU)); | 92 switches::kInProcessGPU)); |
90 #if !defined(OS_ANDROID) | 93 #if !defined(OS_ANDROID) |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 287 } |
285 | 288 |
286 void GpuChildThread::OnGpuSwitched() { | 289 void GpuChildThread::OnGpuSwitched() { |
287 DVLOG(1) << "GPU: GPU has switched"; | 290 DVLOG(1) << "GPU: GPU has switched"; |
288 // Notify observers in the GPU process. | 291 // Notify observers in the GPU process. |
289 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); | 292 ui::GpuSwitchingManager::GetInstance()->NotifyGpuSwitched(); |
290 } | 293 } |
291 | 294 |
292 } // namespace content | 295 } // namespace content |
293 | 296 |
OLD | NEW |