Commit 4d18cc81 authored by kulkarni.a's avatar kulkarni.a Committed by Commit bot

Declaring the weak_ptr_factory in proper order.

Cleaning up weak_ptr_factory destruction order in "src/gpu" module.
WeakPtrFactory should remain the last member so it'll be destroyed and
invalidate its weak pointers before any other members are destroyed.

BUG=303818

Review URL: https://codereview.chromium.org/468913010

Cr-Commit-Position: refs/heads/master@{#291870}
parent 4c2962cc
......@@ -46,6 +46,7 @@ Antonio Gomes <a1.gomes@sisa.samsung.com>
Arnaud Renevier <a.renevier@samsung.com>
Arpita Bahuguna <a.bah@samsung.com>
Arthur Lussos <developer0420@gmail.com>
Arun Kulkarni <kulkarni.a@samsung.com>
Arun Mankuzhi <arun.m@samsung.com>
Arunoday Sarkar <a.sarkar.arun@gmail.com>
Arunprasad Rajkumar <ararunprasad@gmail.com>
......
......@@ -36,8 +36,8 @@ GpuScheduler::GpuScheduler(CommandBufferServiceBase* command_buffer,
decoder_(decoder),
unscheduled_count_(0),
rescheduled_count_(0),
reschedule_task_factory_(this),
was_preempted_(false) {}
was_preempted_(false),
reschedule_task_factory_(this) {}
GpuScheduler::~GpuScheduler() {
}
......
......@@ -136,10 +136,6 @@ class GPU_EXPORT GpuScheduler
// account of a timeout.
int rescheduled_count_;
// A factory for outstanding rescheduling tasks that is invalidated whenever
// the scheduler is rescheduled.
base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_;
// The GpuScheduler will unschedule itself in the event that further GL calls
// are issued to it before all these fences have been crossed by the GPU.
struct UnscheduleFence {
......@@ -160,6 +156,10 @@ class GPU_EXPORT GpuScheduler
scoped_refptr<PreemptionFlag> preemption_flag_;
bool was_preempted_;
// A factory for outstanding rescheduling tasks that is invalidated whenever
// the scheduler is rescheduled.
base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_;
DISALLOW_COPY_AND_ASSIGN(GpuScheduler);
};
......
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