Commit 96f3eba7 authored by kylechar's avatar kylechar Committed by Commit Bot
Browse files

Switch make_scoped_refptr to MakeRefCounted.

This CL replaces instances of make_scoped_refptr() with MakeRefCounted()
for constructing scoped_refptr<>s where possible. MakeRefCounted() only
works if the class has a public constructor, so not all instances are
replaced.

Bug: 765333
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;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
Change-Id: Ic53d512940f7cc53a959e967a63da0ca94a95eae
Reviewed-on: https://chromium-review.googlesource.com/676646


Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504151}
parent 9cb8fa9d
......@@ -247,13 +247,13 @@ void AwBrowserContext::InitUserPrefService() {
safe_browsing::RegisterProfilePrefs(pref_registry);
PrefServiceFactory pref_service_factory;
pref_service_factory.set_user_prefs(make_scoped_refptr(
new InMemoryPrefStore()));
pref_service_factory.set_user_prefs(
base::MakeRefCounted<InMemoryPrefStore>());
pref_service_factory.set_managed_prefs(
make_scoped_refptr(new policy::ConfigurationPolicyPrefStore(
base::MakeRefCounted<policy::ConfigurationPolicyPrefStore>(
browser_policy_connector_->GetPolicyService(),
browser_policy_connector_->GetHandlerList(),
policy::POLICY_LEVEL_MANDATORY)));
policy::POLICY_LEVEL_MANDATORY));
pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError));
user_pref_service_ = pref_service_factory.Create(pref_registry);
pref_change_registrar_.Init(user_pref_service_.get());
......
......@@ -70,7 +70,7 @@ std::unique_ptr<PrefService> AwFieldTrialCreator::CreateLocalState() {
base::MakeUnique<base::ListValue>());
pref_service_factory_.set_user_prefs(
make_scoped_refptr(new InMemoryPrefStore()));
base::MakeRefCounted<InMemoryPrefStore>());
return pref_service_factory_.Create(pref_registry.get());
}
......
......@@ -1472,12 +1472,12 @@ TEST_F(DisplayManagerTest, DontRememberBestResolution) {
display::ManagedDisplayInfo native_display_info =
CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500));
display::ManagedDisplayInfo::ManagedDisplayModeList display_modes;
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(1000, 500), 58.0f, false, true)));
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(800, 300), 59.0f, false, false)));
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(400, 500), 60.0f, false, false)));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(1000, 500), 58.0f, false, true));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(800, 300), 59.0f, false, false));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(400, 500), 60.0f, false, false));
native_display_info.SetManagedDisplayModes(display_modes);
......@@ -1539,12 +1539,12 @@ TEST_F(DisplayManagerTest, ResolutionFallback) {
display::ManagedDisplayInfo native_display_info =
CreateDisplayInfo(display_id, gfx::Rect(0, 0, 1000, 500));
display::ManagedDisplayInfo::ManagedDisplayModeList display_modes;
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(1000, 500), 58.0f, false, true)));
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(800, 300), 59.0f, false, false)));
display_modes.push_back(make_scoped_refptr(new display::ManagedDisplayMode(
gfx::Size(400, 500), 60.0f, false, false)));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(1000, 500), 58.0f, false, true));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(800, 300), 59.0f, false, false));
display_modes.push_back(base::MakeRefCounted<display::ManagedDisplayMode>(
gfx::Size(400, 500), 60.0f, false, false));
display::ManagedDisplayInfo::ManagedDisplayModeList copy = display_modes;
native_display_info.SetManagedDisplayModes(copy);
......
......@@ -14,7 +14,7 @@ namespace base {
namespace ios {
ScopedCriticalAction::ScopedCriticalAction()
: core_(base::MakeRefCounted<ScopedCriticalAction::Core>()) {
: core_(MakeRefCounted<ScopedCriticalAction::Core>()) {
ScopedCriticalAction::Core::StartBackgroundTask(core_);
}
......
......@@ -532,7 +532,7 @@ TEST(ObserverListThreadSafeTest, NotificationOnValidSequence) {
auto task_runner_1 = CreateSequencedTaskRunnerWithTraits(TaskTraits());
auto task_runner_2 = CreateSequencedTaskRunnerWithTraits(TaskTraits());
auto observer_list = make_scoped_refptr(new ObserverListThreadSafe<Foo>());
auto observer_list = MakeRefCounted<ObserverListThreadSafe<Foo>>();
SequenceVerificationObserver observer_1(task_runner_1);
SequenceVerificationObserver observer_2(task_runner_2);
......@@ -558,7 +558,7 @@ TEST(ObserverListThreadSafeTest, NotificationOnValidSequence) {
// from a notification, it is itself notified.
TEST(ObserverListThreadSafeTest, AddObserverFromNotificationNotifyAll) {
test::ScopedTaskEnvironment scoped_task_environment;
auto observer_list = make_scoped_refptr(new ObserverListThreadSafe<Foo>());
auto observer_list = MakeRefCounted<ObserverListThreadSafe<Foo>>();
Adder observer_added_from_notification(1);
......@@ -605,7 +605,7 @@ class RemoveWhileNotificationIsRunningObserver : public Foo {
// Verify that there is no crash when an observer is removed while it is being
// notified.
TEST(ObserverListThreadSafeTest, RemoveWhileNotificationIsRunning) {
auto observer_list = make_scoped_refptr(new ObserverListThreadSafe<Foo>());
auto observer_list = MakeRefCounted<ObserverListThreadSafe<Foo>>();
RemoveWhileNotificationIsRunningObserver observer;
WaitableEvent task_running(WaitableEvent::ResetPolicy::AUTOMATIC,
......
......@@ -61,7 +61,7 @@ class TaskSchedulerDelayedTaskManagerTest : public testing::Test {
testing::StrictMock<MockTaskTarget> task_target_;
const scoped_refptr<TestMockTimeTaskRunner> service_thread_task_runner_ =
make_scoped_refptr(new TestMockTimeTaskRunner);
MakeRefCounted<TestMockTimeTaskRunner>();
DelayedTaskManager delayed_task_manager_;
std::unique_ptr<Task> task_ = CreateTask(kLongDelay);
Task* const task_raw_ = task_.get();
......
......@@ -514,9 +514,9 @@ SchedulerSingleThreadTaskRunnerManager::CreateAndRegisterSchedulerWorker(
ThreadPriority priority_hint) {
lock_.AssertAcquired();
int id = next_worker_id_++;
workers_.emplace_back(make_scoped_refptr(new SchedulerWorker(
workers_.emplace_back(MakeRefCounted<SchedulerWorker>(
priority_hint, CreateSchedulerWorkerDelegate<DelegateType>(name, id),
task_tracker_)));
task_tracker_));
return workers_.back().get();
}
......
......@@ -40,17 +40,17 @@ class MockSchedulerWorkerDelegate : public SchedulerWorker::Delegate {
class TaskSchedulerWorkerStackTest : public testing::Test {
protected:
void SetUp() override {
worker_a_ = make_scoped_refptr(new SchedulerWorker(
worker_a_ = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, WrapUnique(new MockSchedulerWorkerDelegate),
&task_tracker_));
&task_tracker_);
ASSERT_TRUE(worker_a_);
worker_b_ = make_scoped_refptr(new SchedulerWorker(
worker_b_ = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, WrapUnique(new MockSchedulerWorkerDelegate),
&task_tracker_));
&task_tracker_);
ASSERT_TRUE(worker_b_);
worker_c_ = make_scoped_refptr(new SchedulerWorker(
worker_c_ = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, WrapUnique(new MockSchedulerWorkerDelegate),
&task_tracker_));
&task_tracker_);
ASSERT_TRUE(worker_c_);
}
......
......@@ -77,9 +77,9 @@ class TaskSchedulerWorkerTest : public testing::TestWithParam<size_t> {
WaitableEvent::InitialState::NOT_SIGNALED) {}
void SetUp() override {
worker_ = make_scoped_refptr(new SchedulerWorker(
worker_ = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL,
std::make_unique<TestSchedulerWorkerDelegate>(this), &task_tracker_));
std::make_unique<TestSchedulerWorkerDelegate>(this), &task_tracker_);
ASSERT_TRUE(worker_);
worker_->Start();
worker_set_.Signal();
......@@ -512,8 +512,8 @@ TEST(TaskSchedulerWorkerTest, WorkerCleanupFromGetWork) {
delegate->controls();
controls->set_can_cleanup(true);
EXPECT_CALL(*delegate, OnMainEntry(_));
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, WrapUnique(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, WrapUnique(delegate), &task_tracker);
worker->Start();
worker->WakeUp();
controls->WaitForWorkToRun();
......@@ -533,8 +533,8 @@ TEST(TaskSchedulerWorkerTest, WorkerCleanupDuringWork) {
controls->HaveWorkBlock();
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker);
worker->Start();
worker->WakeUp();
......@@ -555,8 +555,8 @@ TEST(TaskSchedulerWorkerTest, WorkerCleanupDuringWait) {
scoped_refptr<ControllableCleanupDelegate::Controls> controls =
delegate->controls();
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker);
worker->Start();
worker->WakeUp();
......@@ -578,8 +578,8 @@ TEST(TaskSchedulerWorkerTest, WorkerCleanupDuringShutdown) {
controls->HaveWorkBlock();
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker);
worker->Start();
worker->WakeUp();
......@@ -603,8 +603,8 @@ TEST(TaskSchedulerWorkerTest, CleanupBeforeStart) {
delegate->controls();
controls->set_expect_get_work(false);
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker);
worker->Cleanup();
worker->Start();
......@@ -652,8 +652,8 @@ TEST(TaskSchedulerWorkerTest, WorkerCleanupDuringJoin) {
controls->HaveWorkBlock();
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker);
worker->Start();
worker->WakeUp();
......@@ -731,8 +731,8 @@ TEST(TaskSchedulerWorkerTest, BumpPriorityOfAliveThreadDuringShutdown) {
? ThreadPriority::BACKGROUND
: ThreadPriority::NORMAL);
auto worker = make_scoped_refptr(new SchedulerWorker(
ThreadPriority::BACKGROUND, std::move(delegate), &task_tracker));
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::BACKGROUND, std::move(delegate), &task_tracker);
worker->Start();
// Verify that the initial thread priority is BACKGROUND (or NORMAL if thread
......@@ -791,9 +791,9 @@ TEST(TaskSchedulerWorkerTest, BackwardCompatibilityEnabled) {
// Create a worker with backward compatibility ENABLED. Wake it up and wait
// until GetWork() returns.
auto worker = make_scoped_refptr(new SchedulerWorker(
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker, nullptr,
SchedulerBackwardCompatibility::INIT_COM_STA));
SchedulerBackwardCompatibility::INIT_COM_STA);
worker->Start();
worker->WakeUp();
delegate_raw->WaitUntilGetWorkReturned();
......@@ -818,9 +818,9 @@ TEST(TaskSchedulerWorkerTest, BackwardCompatibilityDisabled) {
// Create a worker with backward compatibility DISABLED. Wake it up and wait
// until GetWork() returns.
auto worker = make_scoped_refptr(new SchedulerWorker(
auto worker = MakeRefCounted<SchedulerWorker>(
ThreadPriority::NORMAL, std::move(delegate), &task_tracker, nullptr,
SchedulerBackwardCompatibility::DISABLED));
SchedulerBackwardCompatibility::DISABLED);
worker->Start();
worker->WakeUp();
delegate_raw->WaitUntilGetWorkReturned();
......
......@@ -73,13 +73,12 @@ TEST(PostTaskAndReplyImplTest, PostTaskAndReply) {
testing::StrictMock<MockObject> mock_object;
bool delete_flag = false;
EXPECT_TRUE(
PostTaskAndReplyTaskRunner(post_runner.get())
.PostTaskAndReply(
FROM_HERE,
BindOnce(&MockObject::Task, Unretained(&mock_object),
make_scoped_refptr(new ObjectToDelete(&delete_flag))),
BindOnce(&MockObject::Reply, Unretained(&mock_object))));
EXPECT_TRUE(PostTaskAndReplyTaskRunner(post_runner.get())
.PostTaskAndReply(
FROM_HERE,
BindOnce(&MockObject::Task, Unretained(&mock_object),
MakeRefCounted<ObjectToDelete>(&delete_flag)),
BindOnce(&MockObject::Reply, Unretained(&mock_object))));
// Expect the task to be posted to |post_runner|.
EXPECT_TRUE(post_runner->HasPendingTask());
......
......@@ -393,7 +393,7 @@ TEST_P(SequencedWorkerPoolTest, DelayedTaskDuringShutdown) {
EXPECT_TRUE(pool()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&ShouldNotRun,
make_scoped_refptr(new DeletionHelper(deleted_flag))),
MakeRefCounted<DeletionHelper>(deleted_flag)),
TestTimeouts::action_timeout()));
std::vector<int> completion_sequence = tracker()->WaitUntilTasksComplete(1);
......
......@@ -63,7 +63,7 @@ void ExpectNotCalledOnValidThreadWithSequenceTokenAndThreadTaskRunnerHandle(
ThreadCheckerImpl* thread_checker,
SequenceToken sequence_token) {
ThreadTaskRunnerHandle thread_task_runner_handle(
make_scoped_refptr(new TestSimpleTaskRunner));
MakeRefCounted<TestSimpleTaskRunner>());
ScopedSetSequenceTokenForCurrentThread
scoped_set_sequence_token_for_current_thread(sequence_token);
ExpectNotCalledOnValidThread(thread_checker);
......@@ -79,7 +79,7 @@ TEST(ThreadCheckerTest, AllowedSameThreadNoSequenceToken) {
TEST(ThreadCheckerTest,
AllowedSameThreadAndSequenceDifferentTasksWithThreadTaskRunnerHandle) {
ThreadTaskRunnerHandle thread_task_runner_handle(
make_scoped_refptr(new TestSimpleTaskRunner));
MakeRefCounted<TestSimpleTaskRunner>());
std::unique_ptr<ThreadCheckerImpl> thread_checker;
const SequenceToken sequence_token = SequenceToken::Create();
......@@ -130,7 +130,7 @@ TEST(ThreadCheckerTest, DisallowedDifferentThreadsNoSequenceToken) {
TEST(ThreadCheckerTest, DisallowedDifferentThreadsSameSequence) {
ThreadTaskRunnerHandle thread_task_runner_handle(
make_scoped_refptr(new TestSimpleTaskRunner));
MakeRefCounted<TestSimpleTaskRunner>());
const SequenceToken sequence_token(SequenceToken::Create());
ScopedSetSequenceTokenForCurrentThread
......@@ -147,7 +147,7 @@ TEST(ThreadCheckerTest, DisallowedSameThreadDifferentSequence) {
std::unique_ptr<ThreadCheckerImpl> thread_checker;
ThreadTaskRunnerHandle thread_task_runner_handle(
make_scoped_refptr(new TestSimpleTaskRunner));
MakeRefCounted<TestSimpleTaskRunner>());
{
ScopedSetSequenceTokenForCurrentThread
......@@ -180,7 +180,7 @@ TEST(ThreadCheckerTest, DetachFromThread) {
TEST(ThreadCheckerTest, DetachFromThreadWithSequenceToken) {
ThreadTaskRunnerHandle thread_task_runner_handle(
make_scoped_refptr(new TestSimpleTaskRunner));
MakeRefCounted<TestSimpleTaskRunner>());
ScopedSetSequenceTokenForCurrentThread
scoped_set_sequence_token_for_current_thread(SequenceToken::Create());
ThreadCheckerImpl thread_checker;
......
......@@ -508,9 +508,9 @@ TEST_F(MemoryDumpManagerTest, PostTaskForSequencedTaskRunner) {
InitializeMemoryDumpManagerForInProcessTesting(false /* is_coordinator */);
std::vector<MockMemoryDumpProvider> mdps(3);
scoped_refptr<TestSequencedTaskRunner> task_runner1(
make_scoped_refptr(new TestSequencedTaskRunner()));
MakeRefCounted<TestSequencedTaskRunner>());
scoped_refptr<TestSequencedTaskRunner> task_runner2(
make_scoped_refptr(new TestSequencedTaskRunner()));
MakeRefCounted<TestSequencedTaskRunner>());
RegisterDumpProviderWithSequencedTaskRunner(&mdps[0], task_runner1,
kDefaultOptions);
RegisterDumpProviderWithSequencedTaskRunner(&mdps[1], task_runner2,
......
......@@ -37,7 +37,7 @@ class DelayedUniqueNotifierTest : public testing::Test {
void SetUp() override {
notification_count_ = 0;
task_runner_ = make_scoped_refptr(new base::TestSimpleTaskRunner);
task_runner_ = base::MakeRefCounted<base::TestSimpleTaskRunner>();
}
void Notify() { ++notification_count_; }
......
......@@ -76,7 +76,7 @@ gfx::Rect WebContentLayerImpl::PaintableRegion() {
scoped_refptr<cc::DisplayItemList>
WebContentLayerImpl::PaintContentsToDisplayList(
cc::ContentLayerClient::PaintingControlSetting painting_control) {
auto display_list = make_scoped_refptr(new cc::DisplayItemList);
auto display_list = base::MakeRefCounted<cc::DisplayItemList>();
if (client_) {
WebDisplayItemListImpl list(display_list.get());
client_->PaintContents(&list, PaintingControlToWeb(painting_control));
......
......@@ -36,7 +36,7 @@ TEST(WebDisplayItemListImpl, ClipWhenCompositing) {
clip_bounds.x, clip_bounds.y, clip_bounds.width, clip_bounds.height);
SkIRect clip_irect = sk_clip_bounds.roundOut();
auto cc_list = make_scoped_refptr(new cc::DisplayItemList);
auto cc_list = base::MakeRefCounted<cc::DisplayItemList>();
cc_blink::WebDisplayItemListImpl web_list(cc_list.get());
// drawColor(background color)
......
......@@ -72,7 +72,7 @@ TEST(DisplayItemListTest, SingleUnpairedRange) {
PaintFlags red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Point offset(8, 9);
......@@ -108,7 +108,7 @@ TEST(DisplayItemListTest, SingleUnpairedRange) {
TEST(DisplayItemListTest, EmptyUnpairedRangeDoesNotAddVisualRect) {
gfx::Rect layer_rect(100, 100);
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
{
list->StartPaint();
......@@ -134,7 +134,7 @@ TEST(DisplayItemListTest, ClipPairedRange) {
PaintFlags red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Point first_offset(8, 9);
gfx::Rect first_recording_rect(first_offset, layer_rect.size());
......@@ -208,7 +208,7 @@ TEST(DisplayItemListTest, TransformPairedRange) {
PaintFlags red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Point first_offset(8, 9);
gfx::Rect first_recording_rect(first_offset, layer_rect.size());
......@@ -277,7 +277,7 @@ TEST(DisplayItemListTest, FilterPairedRange) {
gfx::Rect layer_rect(100, 100);
FilterOperations filters;
unsigned char pixels[4 * 100 * 100] = {0};
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
sk_sp<SkSurface> source_surface = SkSurface::MakeRasterN32Premul(50, 50);
SkCanvas* source_canvas = source_surface->getCanvas();
......@@ -359,7 +359,7 @@ TEST(DisplayItemListTest, BytesUsed) {
const int kNumPaintOps = 1000;
size_t memory_usage;
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Rect layer_rect(100, 100);
PaintFlags blue_flags;
......@@ -378,7 +378,7 @@ TEST(DisplayItemListTest, BytesUsed) {
}
TEST(DisplayItemListTest, AsValueWithNoOps) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
list->Finalize();
// Pass |true| to ask for PaintOps even though there are none.
......@@ -439,7 +439,7 @@ TEST(DisplayItemListTest, AsValueWithNoOps) {
TEST(DisplayItemListTest, AsValueWithOps) {
gfx::Rect layer_rect = gfx::Rect(1, 2, 8, 9);
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Transform transform;
transform.Translate(6.f, 7.f);
......@@ -540,12 +540,12 @@ TEST(DisplayItemListTest, AsValueWithOps) {
}
TEST(DisplayItemListTest, SizeEmpty) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
EXPECT_EQ(0u, list->op_count());
}
TEST(DisplayItemListTest, SizeOne) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Rect drawing_bounds(5, 6, 1, 1);
{
list->StartPaint();
......@@ -556,7 +556,7 @@ TEST(DisplayItemListTest, SizeOne) {
}
TEST(DisplayItemListTest, SizeMultiple) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
gfx::Rect clip_bounds(5, 6, 7, 8);
{
list->StartPaint();
......@@ -574,7 +574,7 @@ TEST(DisplayItemListTest, SizeMultiple) {
}
TEST(DisplayItemListTest, AppendVisualRectSimple) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// One drawing: D.
......@@ -590,7 +590,7 @@ TEST(DisplayItemListTest, AppendVisualRectSimple) {
}
TEST(DisplayItemListTest, AppendVisualRectEmptyBlock) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// One block: B1, E1.
......@@ -615,7 +615,7 @@ TEST(DisplayItemListTest, AppendVisualRectEmptyBlock) {
}
TEST(DisplayItemListTest, AppendVisualRectEmptyBlockContainingEmptyBlock) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// Two nested blocks: B1, B2, E2, E1.
......@@ -654,7 +654,7 @@ TEST(DisplayItemListTest, AppendVisualRectEmptyBlockContainingEmptyBlock) {
}
TEST(DisplayItemListTest, AppendVisualRectBlockContainingDrawing) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// One block with one drawing: B1, Da, E1.
......@@ -688,7 +688,7 @@ TEST(DisplayItemListTest, AppendVisualRectBlockContainingDrawing) {
}
TEST(DisplayItemListTest, AppendVisualRectBlockContainingEscapedDrawing) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// One block with one drawing: B1, Da (escapes), E1.
......@@ -723,7 +723,7 @@ TEST(DisplayItemListTest, AppendVisualRectBlockContainingEscapedDrawing) {
TEST(DisplayItemListTest,
AppendVisualRectDrawingFollowedByBlockContainingEscapedDrawing) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// One drawing followed by one block with one drawing: Da, B1, Db (escapes),
// E1.
......@@ -766,7 +766,7 @@ TEST(DisplayItemListTest,
}
TEST(DisplayItemListTest, AppendVisualRectTwoBlocksTwoDrawings) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// Multiple nested blocks with drawings amidst: B1, Da, B2, Db, E2, E1.
......@@ -828,7 +828,7 @@ TEST(DisplayItemListTest, AppendVisualRectTwoBlocksTwoDrawings) {
TEST(DisplayItemListTest,
AppendVisualRectTwoBlocksTwoDrawingsInnerDrawingEscaped) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// Multiple nested blocks with drawings amidst: B1, Da, B2, Db (escapes), E2,
// E1.
......@@ -891,7 +891,7 @@ TEST(DisplayItemListTest,
TEST(DisplayItemListTest,
AppendVisualRectTwoBlocksTwoDrawingsOuterDrawingEscaped) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// Multiple nested blocks with drawings amidst: B1, Da (escapes), B2, Db, E2,
// E1.
......@@ -954,7 +954,7 @@ TEST(DisplayItemListTest,
TEST(DisplayItemListTest,
AppendVisualRectTwoBlocksTwoDrawingsBothDrawingsEscaped) {
auto list = make_scoped_refptr(new DisplayItemList);
auto list = base::MakeRefCounted<DisplayItemList>();
// Multiple nested blocks with drawings amidst:
// B1, Da (escapes to the right), B2, Db (escapes to the left), E2, E1.
......
......@@ -221,8 +221,8 @@ class RasterBufferProviderPerfTestBase {
RasterBufferProviderPerfTestBase()
: compositor_context_provider_(
make_scoped_refptr(new PerfContextProvider)),
worker_context_provider_(make_scoped_refptr(new PerfContextProvider)),
base::MakeRefCounted<PerfContextProvider>()),
worker_context_provider_(base::MakeRefCounted<PerfContextProvider>()),
task_runner_(new base::TestSimpleTaskRunner),
task_graph_runner_(new SynchronousTaskGraphRunner),
timer_(kWarmupRuns,
......
......@@ -224,7 +224,7 @@ class TaskGraphRunnerPerfTest : public testing::Test {
void CreateTasks(int num_tasks, PerfTaskImpl::Vector* tasks) {
for (int i = 0; i < num_tasks; ++i)
tasks->push_back(make_scoped_refptr(new PerfTaskImpl));
tasks->push_back(base::MakeRefCounted<PerfTaskImpl>());
}
void CancelTasks(const PerfTaskImpl::Vector& tasks) {
......
......@@ -45,7 +45,7 @@ gfx::Rect FakeContentLayerClient::PaintableRegion() {
scoped_refptr<DisplayItemList>
FakeContentLayerClient::PaintContentsToDisplayList(
PaintingControlSetting painting_contro