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

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

Issue 1891043002: Revert of Use a token to initialise ChannelMojo and MojoApplication everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5a636bcae69af13245c71339e7bc522c9889a5f5..fcf2ff3ac8957bc983289caa35a4fad05d2e9926 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -43,7 +43,6 @@
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/mojo_channel_switches.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/sandbox_type.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
@@ -548,8 +547,8 @@
if (channel_id.empty())
return false;
- DCHECK(!mojo_application_host_);
- mojo_application_host_.reset(new MojoApplicationHost);
+ if (!SetupMojo())
+ return false;
gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine();
if (in_process_) {
@@ -557,8 +556,7 @@
DCHECK(g_gpu_main_thread_factory);
in_process_gpu_thread_.reset(
g_gpu_main_thread_factory(InProcessChildThreadParams(
- channel_id, base::MessageLoop::current()->task_runner(),
- std::string(), mojo_application_host_->GetToken()),
+ channel_id, base::MessageLoop::current()->task_runner()),
gpu_preferences));
base::Thread::Options options;
#if defined(OS_WIN)
@@ -579,6 +577,12 @@
return false;
return true;
+}
+
+bool GpuProcessHost::SetupMojo() {
+ DCHECK(!mojo_application_host_);
+ mojo_application_host_.reset(new MojoApplicationHost);
+ return mojo_application_host_->Init();
}
void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) {
@@ -904,6 +908,14 @@
void GpuProcessHost::OnProcessLaunched() {
UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime",
base::TimeTicks::Now() - init_start_time_);
+
+ base::ProcessHandle handle;
+ if (in_process_)
+ handle = base::GetCurrentProcessHandle();
+ else
+ handle = process_->GetData().handle;
+
+ mojo_application_host_->Activate(this, handle);
}
void GpuProcessHost::OnProcessLaunchFailed() {
@@ -975,8 +987,6 @@
#endif
cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess);
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
- cmd_line->AppendSwitchASCII(switches::kMojoApplicationChannelToken,
- mojo_application_host_->GetToken());
#if defined(OS_WIN)
if (GetContentClient()->browser()->ShouldUseWindowsPrefetchArgument())
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/mojo/mojo_application_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698