diff options
author | kulkarni.a <kulkarni.a@samsung.com> | 2014-08-26 04:30:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-26 11:31:03 +0000 |
commit | 0139e0db513ef473efe0d13c64d76b2c4baf6599 (patch) | |
tree | dd6d75f2367681cbda3707e95d5023b9b4262259 | |
parent | 694731dca94df5c2dbe48bc26368149a59ef5e05 (diff) | |
download | chromium_src-0139e0db513ef473efe0d13c64d76b2c4baf6599.zip chromium_src-0139e0db513ef473efe0d13c64d76b2c4baf6599.tar.gz chromium_src-0139e0db513ef473efe0d13c64d76b2c4baf6599.tar.bz2 |
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}
-rw-r--r-- | cc/resources/image_copy_raster_worker_pool.h | 6 | ||||
-rw-r--r-- | cc/resources/image_raster_worker_pool.h | 4 | ||||
-rw-r--r-- | cc/resources/pixel_buffer_raster_worker_pool.h | 6 | ||||
-rw-r--r-- | cc/test/fake_output_surface.h | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/cc/resources/image_copy_raster_worker_pool.h b/cc/resources/image_copy_raster_worker_pool.h index 62cf3d0..414c700 100644 --- a/cc/resources/image_copy_raster_worker_pool.h +++ b/cc/resources/image_copy_raster_worker_pool.h @@ -102,9 +102,6 @@ class CC_EXPORT ImageCopyRasterWorkerPool : public RasterWorkerPool, bool raster_tasks_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_required_for_activation_finished_task_; @@ -113,6 +110,9 @@ class CC_EXPORT ImageCopyRasterWorkerPool : public RasterWorkerPool, TaskGraph graph_; Task::Vector completed_tasks_; + base::WeakPtrFactory<ImageCopyRasterWorkerPool> + raster_finished_weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(ImageCopyRasterWorkerPool); }; diff --git a/cc/resources/image_raster_worker_pool.h b/cc/resources/image_raster_worker_pool.h index 39ac723..77f53a8 100644 --- a/cc/resources/image_raster_worker_pool.h +++ b/cc/resources/image_raster_worker_pool.h @@ -62,8 +62,6 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, bool raster_tasks_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_required_for_activation_finished_task_; @@ -72,6 +70,8 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool, TaskGraph graph_; Task::Vector completed_tasks_; + base::WeakPtrFactory<ImageRasterWorkerPool> raster_finished_weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(ImageRasterWorkerPool); }; diff --git a/cc/resources/pixel_buffer_raster_worker_pool.h b/cc/resources/pixel_buffer_raster_worker_pool.h index d4fc088..6a6aae8 100644 --- a/cc/resources/pixel_buffer_raster_worker_pool.h +++ b/cc/resources/pixel_buffer_raster_worker_pool.h @@ -128,9 +128,6 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, 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_required_for_activation_finished_task_; @@ -139,6 +136,9 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, TaskGraph graph_; Task::Vector completed_tasks_; + base::WeakPtrFactory<PixelBufferRasterWorkerPool> + raster_finished_weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(PixelBufferRasterWorkerPool); }; diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h index 4fd0d72..193d03c 100644 --- a/cc/test/fake_output_surface.h +++ b/cc/test/fake_output_surface.h @@ -141,8 +141,9 @@ class FakeOutputSurface : public OutputSurface { bool needs_begin_frame_; bool has_external_stencil_test_; TransferableResourceArray resources_held_by_parent_; - base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; + + base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; }; } // namespace cc |