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(
}
GpuChildThread::GpuChildThread(
const gpu::GpuPreferences& gpu_preferences,
const InProcessChildThreadParams& params,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory)
: ChildThreadImpl(ChildThreadImpl::Options::Builder()
......@@ -172,7 +171,6 @@ GpuChildThread::GpuChildThread(
gpu_memory_buffer_factory))
.ConnectToBrowser(true)
.Build()),
gpu_preferences_(gpu_preferences),
dead_on_arrival_(false),
in_browser_process_(true),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory) {
......@@ -313,13 +311,10 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id,
}
void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
gpu_preferences_ = gpu_preferences;
gpu_info_.video_decode_accelerator_capabilities =
media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences);
gpu_info_.video_encode_accelerator_supported_profiles =
media::GpuVideoEncodeAccelerator::GetSupportedProfiles(
gpu_preferences_);
media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences);
gpu_info_.jpeg_decode_accelerator_supported =
media::GpuJpegDecodeAccelerator::IsSupported();
......@@ -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
// IPC messages before the sandbox has been enabled and all other necessary
// initialization has succeeded.
gpu_channel_manager_.reset(
new gpu::GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(),
base::ThreadTaskRunnerHandle::Get().get(),
ChildProcess::current()->io_task_runner(),
ChildProcess::current()->GetShutDownEvent(),
sync_point_manager, gpu_memory_buffer_factory_));
gpu_channel_manager_.reset(new gpu::GpuChannelManager(
gpu_preferences, this, watchdog_thread_.get(),
base::ThreadTaskRunnerHandle::Get().get(),
ChildProcess::current()->io_task_runner(),
ChildProcess::current()->GetShutDownEvent(), sync_point_manager,
gpu_memory_buffer_factory_));
media_service_.reset(new media::MediaService(gpu_channel_manager_.get()));
......@@ -373,8 +368,8 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
&GpuChildThread::BindServiceFactoryRequest, base::Unretained(this)));
if (GetContentClient()->gpu()) { // NULL in tests.
GetContentClient()->gpu()->ExposeInterfacesToBrowser(
GetInterfaceRegistry(), gpu_preferences_);
GetContentClient()->gpu()->ExposeInterfacesToBrowser(GetInterfaceRegistry(),
gpu_preferences);
GetContentClient()->gpu()->ConsumeInterfacesFromBrowser(
GetRemoteInterfaces());
}
......
......@@ -64,8 +64,7 @@ class GpuChildThread : public ChildThreadImpl,
const DeferredMessages& deferred_messages,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory);
GpuChildThread(const gpu::GpuPreferences& gpu_preferences,
const InProcessChildThreadParams& params,
GpuChildThread(const InProcessChildThreadParams& params,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory);
~GpuChildThread() override;
......@@ -75,8 +74,6 @@ class GpuChildThread : public ChildThreadImpl,
void Init(const base::Time& process_start_time);
void StopWatchdog();
gpu::GpuPreferences gpu_preferences() { return gpu_preferences_; }
private:
// ChildThreadImpl:.
bool Send(IPC::Message* msg) override;
......@@ -131,8 +128,6 @@ class GpuChildThread : public ChildThreadImpl,
void BindServiceFactoryRequest(shell::mojom::ServiceFactoryRequest request);
gpu::GpuPreferences gpu_preferences_;
// Set this flag to true if a fatal error occurred before we receive the
// OnInitialize message, in which case we just declare ourselves DOA.
bool dead_on_arrival_;
......
......@@ -50,8 +50,8 @@ void InProcessGpuThread::Init() {
// The process object takes ownership of the thread object, so do not
// save and delete the pointer.
GpuChildThread* child_thread = new GpuChildThread(
gpu_preferences_, params_, gpu_memory_buffer_factory_.get());
GpuChildThread* child_thread =
new GpuChildThread(params_, gpu_memory_buffer_factory_.get());
// Since we are in the browser process, use the thread start time as the
// process start time.
......
......@@ -18,6 +18,7 @@
#include "base/memory/weak_ptr.h"
#include "build/build_config.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/gpu_export.h"
#include "gpu/ipc/service/gpu_memory_manager.h"
......@@ -169,7 +170,7 @@ class GPU_EXPORT GpuChannelManager {
void DoWakeUpGpu();
#endif
const GpuPreferences& gpu_preferences_;
const GpuPreferences gpu_preferences_;
GpuDriverBugWorkarounds gpu_driver_bug_workarounds_;
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