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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2514923002: content: Use mus client-lib's gpu-service from renderers. (Closed)
Patch Set: . Created 4 years 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/renderer/render_thread_impl.h ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 8a8a3e651a15b91ddd65917593f0eb92a7ff87f4..dd362bfa754e345f8fb65eac126830b02e06355c 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -53,7 +53,6 @@
#include "content/child/appcache/appcache_dispatcher.h"
#include "content/child/appcache/appcache_frontend_impl.h"
#include "content/child/blob_storage/blob_message_filter.h"
-#include "content/child/child_gpu_memory_buffer_manager.h"
#include "content/child/child_histogram_message_filter.h"
#include "content/child/child_resource_message_filter.h"
#include "content/child/child_shared_bitmap_manager.h"
@@ -198,12 +197,10 @@
#include "v8/src/third_party/vtune/v8-vtune.h"
#endif
-#if defined(USE_AURA)
#include "content/public/common/service_manager_connection.h"
#include "content/renderer/mus/render_widget_mus_connection.h"
#include "content/renderer/mus/render_widget_window_tree_client_factory.h"
#include "services/ui/public/cpp/gpu/gpu.h"
-#endif
#if defined(ENABLE_IPC_FUZZER)
#include "content/common/external_ipc_dumper.h"
@@ -653,14 +650,13 @@ void RenderThreadImpl::Init(
// Register this object as the main thread.
ChildProcess::current()->set_main_thread(this);
-#if defined(USE_AURA)
if (IsRunningInMash()) {
gpu_ = ui::Gpu::Create(GetServiceManagerConnection()->GetConnector(),
ChildProcess::current()->io_task_runner());
+ } else {
+ gpu_ = ui::Gpu::Create(GetRemoteInterfaces(),
+ ChildProcess::current()->io_task_runner());
}
-#endif
- gpu_memory_buffer_manager_ =
- base::MakeUnique<ChildGpuMemoryBufferManager>(thread_safe_sender());
thread_safe_associated_interface_ptr_provider_ =
base::MakeUnique<ThreadSafeAssociatedInterfacePtrProvider>(channel());
@@ -1658,11 +1654,7 @@ RenderThreadImpl::GetCompositorImplThreadTaskRunner() {
}
gpu::GpuMemoryBufferManager* RenderThreadImpl::GetGpuMemoryBufferManager() {
-#if defined(USE_AURA)
- if (gpu_)
- return gpu_->gpu_memory_buffer_manager();
-#endif
- return gpu_memory_buffer_manager_.get();
+ return gpu_->gpu_memory_buffer_manager();
}
blink::scheduler::RendererScheduler* RenderThreadImpl::GetRendererScheduler() {
@@ -1720,16 +1712,6 @@ bool RenderThreadImpl::IsMainThread() {
return !!current();
}
-scoped_refptr<base::SingleThreadTaskRunner>
-RenderThreadImpl::GetIOThreadTaskRunner() {
- return io_thread_task_runner_;
-}
-
-std::unique_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory(
- size_t size) {
- return HostAllocateSharedMemoryBuffer(size);
-}
-
void RenderThreadImpl::OnChannelError() {
// In single-process mode, the renderer can't be restarted after shutdown.
// So, if we get a channel error, crash the whole process right now to get a
@@ -1919,34 +1901,9 @@ scoped_refptr<gpu::GpuChannelHost> RenderThreadImpl::EstablishGpuChannelSync() {
gpu_channel_ = nullptr;
}
- if (!IsRunningInMash()) {
- int client_id = 0;
- IPC::ChannelHandle channel_handle;
- gpu::GPUInfo gpu_info;
- // Ask the browser for the channel name.
- if (!Send(new ChildProcessHostMsg_EstablishGpuChannel(
- &client_id, &channel_handle, &gpu_info)) ||
- !channel_handle.mojo_handle.is_valid()) {
- // Otherwise cancel the connection.
- return nullptr;
- }
- GetContentClient()->SetGpuInfo(gpu_info);
-
- // Cache some variables that are needed on the compositor thread for our
- // implementation of GpuChannelHostFactory.
- io_thread_task_runner_ = ChildProcess::current()->io_task_runner();
-
- gpu_channel_ =
- gpu::GpuChannelHost::Create(this, client_id, gpu_info, channel_handle,
- ChildProcess::current()->GetShutDownEvent(),
- GetGpuMemoryBufferManager());
- } else {
-#if defined(USE_AURA)
- gpu_channel_ = gpu_->EstablishGpuChannelSync();
-#else
- NOTREACHED();
-#endif
- }
+ gpu_channel_ = gpu_->EstablishGpuChannelSync();
+ if (gpu_channel_)
+ GetContentClient()->SetGpuInfo(gpu_channel_->gpu_info());
return gpu_channel_;
}
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698