Commit 3f8d0fab authored by sadrul's avatar sadrul Committed by Commit bot

gpu: Remove unused GpuChildThread::gpu_preferences_.

GpuChildThread itself never uses |gpu_preferences_|. However,
GpuChannelManager holds a reference to it. So remove it from
GpuChildThread, and have GpuChannelManager, which actually uses
it, own it instead.

BUG=none
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2322893002
Cr-Commit-Position: refs/heads/master@{#417331}
parent cb637fa0
...@@ -162,7 +162,6 @@ GpuChildThread::GpuChildThread( ...@@ -162,7 +162,6 @@ GpuChildThread::GpuChildThread(
} }
GpuChildThread::GpuChildThread( GpuChildThread::GpuChildThread(
const gpu::GpuPreferences& gpu_preferences,
const InProcessChildThreadParams& params, const InProcessChildThreadParams& params,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory) gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory)
: ChildThreadImpl(ChildThreadImpl::Options::Builder() : ChildThreadImpl(ChildThreadImpl::Options::Builder()
...@@ -172,7 +171,6 @@ GpuChildThread::GpuChildThread( ...@@ -172,7 +171,6 @@ GpuChildThread::GpuChildThread(
gpu_memory_buffer_factory)) gpu_memory_buffer_factory))
.ConnectToBrowser(true) .ConnectToBrowser(true)
.Build()), .Build()),
gpu_preferences_(gpu_preferences),
dead_on_arrival_(false), dead_on_arrival_(false),
in_browser_process_(true), in_browser_process_(true),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory) { gpu_memory_buffer_factory_(gpu_memory_buffer_factory) {
...@@ -313,13 +311,10 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id, ...@@ -313,13 +311,10 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id,
} }
void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
gpu_preferences_ = gpu_preferences;
gpu_info_.video_decode_accelerator_capabilities = gpu_info_.video_decode_accelerator_capabilities =
media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences);
gpu_info_.video_encode_accelerator_supported_profiles = gpu_info_.video_encode_accelerator_supported_profiles =
media::GpuVideoEncodeAccelerator::GetSupportedProfiles( media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences);
gpu_preferences_);
gpu_info_.jpeg_decode_accelerator_supported = gpu_info_.jpeg_decode_accelerator_supported =
media::GpuJpegDecodeAccelerator::IsSupported(); media::GpuJpegDecodeAccelerator::IsSupported();
...@@ -357,12 +352,12 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { ...@@ -357,12 +352,12 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
// Defer creation of the render thread. This is to prevent it from handling // Defer creation of the render thread. This is to prevent it from handling
// IPC messages before the sandbox has been enabled and all other necessary // IPC messages before the sandbox has been enabled and all other necessary
// initialization has succeeded. // initialization has succeeded.
gpu_channel_manager_.reset( gpu_channel_manager_.reset(new gpu::GpuChannelManager(
new gpu::GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(), gpu_preferences, this, watchdog_thread_.get(),
base::ThreadTaskRunnerHandle::Get().get(), base::ThreadTaskRunnerHandle::Get().get(),
ChildProcess::current()->io_task_runner(), ChildProcess::current()->io_task_runner(),
ChildProcess::current()->GetShutDownEvent(), ChildProcess::current()->GetShutDownEvent(), sync_point_manager,
sync_point_manager, gpu_memory_buffer_factory_)); gpu_memory_buffer_factory_));
media_service_.reset(new media::MediaService(gpu_channel_manager_.get())); media_service_.reset(new media::MediaService(gpu_channel_manager_.get()));
...@@ -373,8 +368,8 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { ...@@ -373,8 +368,8 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
&GpuChildThread::BindServiceFactoryRequest, base::Unretained(this))); &GpuChildThread::BindServiceFactoryRequest, base::Unretained(this)));
if (GetContentClient()->gpu()) { // NULL in tests. if (GetContentClient()->gpu()) { // NULL in tests.
GetContentClient()->gpu()->ExposeInterfacesToBrowser( GetContentClient()->gpu()->ExposeInterfacesToBrowser(GetInterfaceRegistry(),
GetInterfaceRegistry(), gpu_preferences_); gpu_preferences);
GetContentClient()->gpu()->ConsumeInterfacesFromBrowser( GetContentClient()->gpu()->ConsumeInterfacesFromBrowser(
GetRemoteInterfaces()); GetRemoteInterfaces());
} }
......
...@@ -64,8 +64,7 @@ class GpuChildThread : public ChildThreadImpl, ...@@ -64,8 +64,7 @@ class GpuChildThread : public ChildThreadImpl,
const DeferredMessages& deferred_messages, const DeferredMessages& deferred_messages,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory);
GpuChildThread(const gpu::GpuPreferences& gpu_preferences, GpuChildThread(const InProcessChildThreadParams& params,
const InProcessChildThreadParams& params,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory);
~GpuChildThread() override; ~GpuChildThread() override;
...@@ -75,8 +74,6 @@ class GpuChildThread : public ChildThreadImpl, ...@@ -75,8 +74,6 @@ class GpuChildThread : public ChildThreadImpl,
void Init(const base::Time& process_start_time); void Init(const base::Time& process_start_time);
void StopWatchdog(); void StopWatchdog();
gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; }
private: private:
// ChildThreadImpl:. // ChildThreadImpl:.
bool Send(IPC::Message* msg) override; bool Send(IPC::Message* msg) override;
...@@ -131,8 +128,6 @@ class GpuChildThread : public ChildThreadImpl, ...@@ -131,8 +128,6 @@ class GpuChildThread : public ChildThreadImpl,
void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request); void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request);
gpu::GpuPreferences gpu_preferences_;
// Set this flag to true if a fatal error occurred before we receive the // Set this flag to true if a fatal error occurred before we receive the
// OnInitialize message, in which case we just declare ourselves DOA. // OnInitialize message, in which case we just declare ourselves DOA.
bool dead_on_arrival_; bool dead_on_arrival_;
......
...@@ -50,8 +50,8 @@ void InProcessGpuThread::Init() { ...@@ -50,8 +50,8 @@ void InProcessGpuThread::Init() {
// The process object takes ownership of the thread object, so do not // The process object takes ownership of the thread object, so do not
// save and delete the pointer. // save and delete the pointer.
GpuChildThread* child_thread = new GpuChildThread( GpuChildThread* child_thread =
gpu_preferences_, params_, gpu_memory_buffer_factory_.get()); new GpuChildThread(params_, gpu_memory_buffer_factory_.get());
// Since we are in the browser process, use the thread start time as the // Since we are in the browser process, use the thread start time as the
// process start time. // process start time.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/config/gpu_driver_bug_workarounds.h"
#include "gpu/gpu_export.h" #include "gpu/gpu_export.h"
#include "gpu/ipc/service/gpu_memory_manager.h" #include "gpu/ipc/service/gpu_memory_manager.h"
...@@ -169,7 +170,7 @@ class GPU_EXPORT GpuChannelManager { ...@@ -169,7 +170,7 @@ class GPU_EXPORT GpuChannelManager {
void DoWakeUpGpu(); void DoWakeUpGpu();
#endif #endif
const GpuPreferences& gpu_preferences_; const GpuPreferences gpu_preferences_;
GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; GpuDriverBugWorkarounds gpu_driver_bug_workarounds_;
GpuChannelManagerDelegate* const delegate_; GpuChannelManagerDelegate* const delegate_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment