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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 2038423004: Use ChannelMojo for Browser-GPU and Renderer-GPU IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-utility-channel-mojo
Patch Set: fix pepper Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 67113b67bf76e8cf2a2ead2a447efdcd1485dad8..1ee8ff1e0c76a86e76aa9bd7f9312fb3a609b19e 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -546,8 +546,9 @@ bool GpuProcessHost::Init() {
TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD);
- std::string channel_id = process_->GetHost()->CreateChannel();
- if (channel_id.empty())
+ const std::string mojo_channel_token =
+ process_->GetHost()->CreateChannelMojo(child_token_);
+ if (mojo_channel_token.empty())
return false;
DCHECK(!mojo_application_host_);
@@ -559,8 +560,8 @@ bool GpuProcessHost::Init() {
DCHECK(g_gpu_main_thread_factory);
in_process_gpu_thread_.reset(g_gpu_main_thread_factory(
InProcessChildThreadParams(
- channel_id, base::ThreadTaskRunnerHandle::Get(), std::string(),
- mojo_application_host_->GetToken()),
+ std::string(), base::ThreadTaskRunnerHandle::Get(),
+ mojo_channel_token, mojo_application_host_->GetToken()),
gpu_preferences));
base::Thread::Options options;
#if defined(OS_WIN)
@@ -573,7 +574,7 @@ bool GpuProcessHost::Init() {
in_process_gpu_thread_->StartWithOptions(options);
OnProcessLaunched(); // Fake a callback that the process is ready.
- } else if (!LaunchGpuProcess(channel_id, &gpu_preferences)) {
+ } else if (!LaunchGpuProcess(mojo_channel_token, &gpu_preferences)) {
return false;
}
@@ -829,7 +830,7 @@ void GpuProcessHost::OnChannelEstablished(
// Currently if any of the GPU features are blacklisted, we don't establish a
// GPU channel.
- if (!channel_handle.name.empty() &&
+ if (channel_handle.mojo_handle.is_valid() &&
!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) {
Send(new GpuMsg_CloseChannel(request.client_id));
request.callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
@@ -966,7 +967,7 @@ void GpuProcessHost::StopGpuProcess() {
Send(new GpuMsg_Finalize());
}
-bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id,
+bool GpuProcessHost::LaunchGpuProcess(const std::string& mojo_channel_token,
gpu::GpuPreferences* gpu_preferences) {
if (!(gpu_enabled_ &&
GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()) &&
@@ -1002,7 +1003,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id,
base::CommandLine* cmd_line = new base::CommandLine(exe_path);
#endif
cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
+ cmd_line->AppendSwitchASCII(switches::kMojoChannelToken, mojo_channel_token);
cmd_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken,
mojo_application_host_->GetToken());
BrowserChildProcessHostImpl::CopyFeatureAndFieldTrialFlags(cmd_line);
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/pepper_flash_settings_helper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698