Commit 03fd3976 authored by kulkarni.a's avatar kulkarni.a Committed by Commit bot

Declaring the weak_ptr_factory in proper order in src/cc.

Cleaning up weak_ptr_factory destruction order.
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/581563002

Cr-Commit-Position: refs/heads/master@{#295279}
parent 33f197bf
...@@ -46,8 +46,8 @@ OutputSurface::OutputSurface( ...@@ -46,8 +46,8 @@ OutputSurface::OutputSurface(
context_provider_(context_provider), context_provider_(context_provider),
device_scale_factor_(-1), device_scale_factor_(-1),
external_stencil_test_enabled_(false), external_stencil_test_enabled_(false),
weak_ptr_factory_(this), gpu_latency_history_(kGpuLatencyHistorySize),
gpu_latency_history_(kGpuLatencyHistorySize) { weak_ptr_factory_(this) {
} }
OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device)
...@@ -55,8 +55,8 @@ OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) ...@@ -55,8 +55,8 @@ OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device)
software_device_(software_device.Pass()), software_device_(software_device.Pass()),
device_scale_factor_(-1), device_scale_factor_(-1),
external_stencil_test_enabled_(false), external_stencil_test_enabled_(false),
weak_ptr_factory_(this), gpu_latency_history_(kGpuLatencyHistorySize),
gpu_latency_history_(kGpuLatencyHistorySize) { weak_ptr_factory_(this) {
} }
OutputSurface::OutputSurface( OutputSurface::OutputSurface(
...@@ -67,8 +67,8 @@ OutputSurface::OutputSurface( ...@@ -67,8 +67,8 @@ OutputSurface::OutputSurface(
software_device_(software_device.Pass()), software_device_(software_device.Pass()),
device_scale_factor_(-1), device_scale_factor_(-1),
external_stencil_test_enabled_(false), external_stencil_test_enabled_(false),
weak_ptr_factory_(this), gpu_latency_history_(kGpuLatencyHistorySize),
gpu_latency_history_(kGpuLatencyHistorySize) { weak_ptr_factory_(this) {
} }
void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase,
......
...@@ -178,12 +178,12 @@ class CC_EXPORT OutputSurface { ...@@ -178,12 +178,12 @@ class CC_EXPORT OutputSurface {
bool external_stencil_test_enabled_; bool external_stencil_test_enabled_;
base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
std::deque<unsigned> available_gpu_latency_query_ids_; std::deque<unsigned> available_gpu_latency_query_ids_;
std::deque<unsigned> pending_gpu_latency_query_ids_; std::deque<unsigned> pending_gpu_latency_query_ids_;
RollingTimeDeltaHistory gpu_latency_history_; RollingTimeDeltaHistory gpu_latency_history_;
base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(OutputSurface); DISALLOW_COPY_AND_ASSIGN(OutputSurface);
}; };
......
...@@ -60,8 +60,6 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, ...@@ -60,8 +60,6 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool,
bool raster_tasks_pending_; bool raster_tasks_pending_;
bool raster_tasks_required_for_activation_pending_; bool raster_tasks_required_for_activation_pending_;
base::WeakPtrFactory<GpuRasterWorkerPool> raster_finished_weak_ptr_factory_;
scoped_refptr<RasterizerTask> raster_finished_task_; scoped_refptr<RasterizerTask> raster_finished_task_;
scoped_refptr<RasterizerTask> raster_required_for_activation_finished_task_; scoped_refptr<RasterizerTask> raster_required_for_activation_finished_task_;
...@@ -70,6 +68,8 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, ...@@ -70,6 +68,8 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool,
TaskGraph graph_; TaskGraph graph_;
Task::Vector completed_tasks_; Task::Vector completed_tasks_;
base::WeakPtrFactory<GpuRasterWorkerPool> raster_finished_weak_ptr_factory_;
base::WeakPtrFactory<GpuRasterWorkerPool> weak_ptr_factory_; base::WeakPtrFactory<GpuRasterWorkerPool> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(GpuRasterWorkerPool); DISALLOW_COPY_AND_ASSIGN(GpuRasterWorkerPool);
......
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