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

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 2459973002: Expedite discovery of primary DRM device. (Closed)
Patch Set: Fix unused-function warning on non-ozone platforms. Created 4 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
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/browser/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 #if defined(OS_WIN) 76 #if defined(OS_WIN)
77 #include "base/win/windows_version.h" 77 #include "base/win/windows_version.h"
78 #include "content/common/sandbox_win.h" 78 #include "content/common/sandbox_win.h"
79 #include "sandbox/win/src/sandbox_policy.h" 79 #include "sandbox/win/src/sandbox_policy.h"
80 #include "ui/gfx/switches.h" 80 #include "ui/gfx/switches.h"
81 #include "ui/gfx/win/rendering_window_manager.h" 81 #include "ui/gfx/win/rendering_window_manager.h"
82 #endif 82 #endif
83 83
84 #if defined(USE_OZONE) 84 #if defined(USE_OZONE)
85 #include "ui/ozone/public/gpu_platform_support_host.h"
86 #include "ui/ozone/public/ozone_platform.h"
85 #include "ui/ozone/public/ozone_switches.h" 87 #include "ui/ozone/public/ozone_switches.h"
86 #endif 88 #endif
87 89
88 #if defined(USE_X11) && !defined(OS_CHROMEOS) 90 #if defined(USE_X11) && !defined(OS_CHROMEOS)
89 #include "ui/gfx/x/x11_switches.h" // nogncheck 91 #include "ui/gfx/x/x11_switches.h" // nogncheck
90 #endif 92 #endif
91 93
92 #if defined(OS_MACOSX) || defined(OS_ANDROID) 94 #if defined(OS_MACOSX) || defined(OS_ANDROID)
93 #include "gpu/ipc/common/gpu_surface_tracker.h" 95 #include "gpu/ipc/common/gpu_surface_tracker.h"
94 #endif 96 #endif
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 bool force_create, 180 bool force_create,
179 IPC::Message* message) { 181 IPC::Message* message) {
180 GpuProcessHost* host = GpuProcessHost::Get(kind, force_create); 182 GpuProcessHost* host = GpuProcessHost::Get(kind, force_create);
181 if (host) { 183 if (host) {
182 host->Send(message); 184 host->Send(message);
183 } else { 185 } else {
184 delete message; 186 delete message;
185 } 187 }
186 } 188 }
187 189
190 #if defined(USE_OZONE)
191 void SendGpuProcessMessageByHostId(int host_id, IPC::Message* message) {
192 GpuProcessHost* host = GpuProcessHost::FromID(host_id);
193 if (host) {
194 host->Send(message);
195 } else {
196 delete message;
197 }
198 }
199 #endif
200
188 // NOTE: changes to this class need to be reviewed by the security team. 201 // NOTE: changes to this class need to be reviewed by the security team.
189 class GpuSandboxedProcessLauncherDelegate 202 class GpuSandboxedProcessLauncherDelegate
190 : public SandboxedProcessLauncherDelegate { 203 : public SandboxedProcessLauncherDelegate {
191 public: 204 public:
192 GpuSandboxedProcessLauncherDelegate(base::CommandLine* cmd_line, 205 GpuSandboxedProcessLauncherDelegate(base::CommandLine* cmd_line,
193 ChildProcessHost* host) 206 ChildProcessHost* host)
194 #if defined(OS_WIN) 207 #if defined(OS_WIN)
195 : cmd_line_(cmd_line) {} 208 : cmd_line_(cmd_line) {}
196 #elif defined(OS_POSIX) 209 #elif defined(OS_POSIX)
197 : ipc_fd_(host->TakeClientFileDescriptor()) {} 210 : ipc_fd_(host->TakeClientFileDescriptor()) {}
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 switches::kInProcessGPU)) { 461 switches::kInProcessGPU)) {
449 in_process_ = true; 462 in_process_ = true;
450 } 463 }
451 464
452 // If the 'single GPU process' policy ever changes, we still want to maintain 465 // If the 'single GPU process' policy ever changes, we still want to maintain
453 // it for 'gpu thread' mode and only create one instance of host and thread. 466 // it for 'gpu thread' mode and only create one instance of host and thread.
454 DCHECK(!in_process_ || g_gpu_process_hosts[kind] == NULL); 467 DCHECK(!in_process_ || g_gpu_process_hosts[kind] == NULL);
455 468
456 g_gpu_process_hosts[kind] = this; 469 g_gpu_process_hosts[kind] = this;
457 470
471 #if defined(USE_OZONE)
472 ui::OzonePlatform::GetInstance()
473 ->GetGpuPlatformSupportHost()
474 ->OnGpuProcessLaunched(
piman 2016/10/31 23:41:49 The GPU process hasn't been launched yet, though..
hshi1 2016/11/01 01:00:48 Done.
475 host_id, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
476 base::Bind(&SendGpuProcessMessageByHostId, host_id));
477 #endif
478
458 // Post a task to create the corresponding GpuProcessHostUIShim. The 479 // Post a task to create the corresponding GpuProcessHostUIShim. The
459 // GpuProcessHostUIShim will be destroyed if either the browser exits, 480 // GpuProcessHostUIShim will be destroyed if either the browser exits,
460 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the 481 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the
461 // GpuProcessHost is destroyed, which happens when the corresponding GPU 482 // GpuProcessHost is destroyed, which happens when the corresponding GPU
462 // process terminates or fails to launch. 483 // process terminates or fails to launch.
463 BrowserThread::PostTask( 484 BrowserThread::PostTask(
464 BrowserThread::UI, 485 BrowserThread::UI,
465 FROM_HERE, 486 FROM_HERE,
466 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create), host_id)); 487 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create), host_id));
467 488
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1187 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1167 ClientIdToShaderCacheMap::iterator iter = 1188 ClientIdToShaderCacheMap::iterator iter =
1168 client_id_to_shader_cache_.find(client_id); 1189 client_id_to_shader_cache_.find(client_id);
1169 // If the cache doesn't exist then this is an off the record profile. 1190 // If the cache doesn't exist then this is an off the record profile.
1170 if (iter == client_id_to_shader_cache_.end()) 1191 if (iter == client_id_to_shader_cache_.end())
1171 return; 1192 return;
1172 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1193 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1173 } 1194 }
1174 1195
1175 } // namespace content 1196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698