Commit 0139e0db 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.
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/479183002

Cr-Commit-Position: refs/heads/master@{#291885}
parent 694731dc
...@@ -102,9 +102,6 @@ class CC_EXPORT ImageCopyRasterWorkerPool : public RasterWorkerPool, ...@@ -102,9 +102,6 @@ class CC_EXPORT ImageCopyRasterWorkerPool : 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<ImageCopyRasterWorkerPool>
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_;
...@@ -113,6 +110,9 @@ class CC_EXPORT ImageCopyRasterWorkerPool : public RasterWorkerPool, ...@@ -113,6 +110,9 @@ class CC_EXPORT ImageCopyRasterWorkerPool : public RasterWorkerPool,
TaskGraph graph_; TaskGraph graph_;
Task::Vector completed_tasks_; Task::Vector completed_tasks_;
base::WeakPtrFactory<ImageCopyRasterWorkerPool>
raster_finished_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ImageCopyRasterWorkerPool); DISALLOW_COPY_AND_ASSIGN(ImageCopyRasterWorkerPool);
}; };
......
...@@ -62,8 +62,6 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, ...@@ -62,8 +62,6 @@ class CC_EXPORT ImageRasterWorkerPool : 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<ImageRasterWorkerPool> 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_;
...@@ -72,6 +70,8 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, ...@@ -72,6 +70,8 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool,
TaskGraph graph_; TaskGraph graph_;
Task::Vector completed_tasks_; Task::Vector completed_tasks_;
base::WeakPtrFactory<ImageRasterWorkerPool> raster_finished_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool);
}; };
......
...@@ -128,9 +128,6 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, ...@@ -128,9 +128,6 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool,
DelayedUniqueNotifier check_for_completed_raster_task_notifier_; DelayedUniqueNotifier check_for_completed_raster_task_notifier_;
base::WeakPtrFactory<PixelBufferRasterWorkerPool>
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_;
...@@ -139,6 +136,9 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, ...@@ -139,6 +136,9 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool,
TaskGraph graph_; TaskGraph graph_;
Task::Vector completed_tasks_; Task::Vector completed_tasks_;
base::WeakPtrFactory<PixelBufferRasterWorkerPool>
raster_finished_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PixelBufferRasterWorkerPool); DISALLOW_COPY_AND_ASSIGN(PixelBufferRasterWorkerPool);
}; };
......
...@@ -141,8 +141,9 @@ class FakeOutputSurface : public OutputSurface { ...@@ -141,8 +141,9 @@ class FakeOutputSurface : public OutputSurface {
bool needs_begin_frame_; bool needs_begin_frame_;
bool has_external_stencil_test_; bool has_external_stencil_test_;
TransferableResourceArray resources_held_by_parent_; TransferableResourceArray resources_held_by_parent_;
base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_;
scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_;
base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_;
}; };
} // namespace cc } // namespace cc
......
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