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

Side by Side Diff: gpu/ipc/service/gpu_channel_test_common.cc

Issue 2257713003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.cc ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/ipc/service/gpu_channel_test_common.h" 5 #include "gpu/ipc/service/gpu_channel_test_common.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/test/test_simple_task_runner.h" 8 #include "base/test/test_simple_task_runner.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "gpu/command_buffer/service/sync_point_manager.h" 10 #include "gpu/command_buffer/service/sync_point_manager.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // overridden Send method. 68 // overridden Send method.
69 gpu_channels_.clear(); 69 gpu_channels_.clear();
70 } 70 }
71 71
72 std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel( 72 std::unique_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
73 int client_id, 73 int client_id,
74 uint64_t client_tracing_id, 74 uint64_t client_tracing_id,
75 bool preempts, 75 bool preempts,
76 bool allow_view_command_buffers, 76 bool allow_view_command_buffers,
77 bool allow_real_time_streams) { 77 bool allow_real_time_streams) {
78 return base::WrapUnique(new TestGpuChannel( 78 return base::MakeUnique<TestGpuChannel>(
79 this, sync_point_manager(), share_group(), mailbox_manager(), 79 this, sync_point_manager(), share_group(), mailbox_manager(),
80 preempts ? preemption_flag() : nullptr, 80 preempts ? preemption_flag() : nullptr,
81 preempts ? nullptr : preemption_flag(), task_runner_.get(), 81 preempts ? nullptr : preemption_flag(), task_runner_.get(),
82 io_task_runner_.get(), client_id, client_tracing_id, 82 io_task_runner_.get(), client_id, client_tracing_id,
83 allow_view_command_buffers, allow_real_time_streams)); 83 allow_view_command_buffers, allow_real_time_streams);
84 } 84 }
85 85
86 TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager, 86 TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager,
87 SyncPointManager* sync_point_manager, 87 SyncPointManager* sync_point_manager,
88 gl::GLShareGroup* share_group, 88 gl::GLShareGroup* share_group,
89 gles2::MailboxManager* mailbox_manager, 89 gles2::MailboxManager* mailbox_manager,
90 PreemptionFlag* preempting_flag, 90 PreemptionFlag* preempting_flag,
91 PreemptionFlag* preempted_flag, 91 PreemptionFlag* preempted_flag,
92 base::SingleThreadTaskRunner* task_runner, 92 base::SingleThreadTaskRunner* task_runner,
93 base::SingleThreadTaskRunner* io_task_runner, 93 base::SingleThreadTaskRunner* io_task_runner,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 io_task_runner_.get(), sync_point_manager_.get(), nullptr)); 149 io_task_runner_.get(), sync_point_manager_.get(), nullptr));
150 } 150 }
151 151
152 void GpuChannelTestCommon::TearDown() { 152 void GpuChannelTestCommon::TearDown() {
153 // Destroying channels causes tasks to run on the IO task runner. 153 // Destroying channels causes tasks to run on the IO task runner.
154 channel_manager_ = nullptr; 154 channel_manager_ = nullptr;
155 } 155 }
156 156
157 157
158 } // namespace gpu 158 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel_manager.cc ('k') | gpu/ipc/service/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698