diff options
author | kulkarni.a <kulkarni.a@samsung.com> | 2014-09-17 08:42:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-17 15:43:04 +0000 |
commit | 03fd39760cfd31da392e596be40fd06c9eff6bf6 (patch) | |
tree | 80f128a4abde8e205530962b5f1bb03385a20357 /cc | |
parent | 33f197bf06e457f0a2a3616f15e0f44683cc2a2c (diff) | |
download | chromium_src-03fd39760cfd31da392e596be40fd06c9eff6bf6.zip chromium_src-03fd39760cfd31da392e596be40fd06c9eff6bf6.tar.gz chromium_src-03fd39760cfd31da392e596be40fd06c9eff6bf6.tar.bz2 |
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}
Diffstat (limited to 'cc')
-rw-r--r-- | cc/output/output_surface.cc | 12 | ||||
-rw-r--r-- | cc/output/output_surface.h | 4 | ||||
-rw-r--r-- | cc/resources/gpu_raster_worker_pool.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index 27b3fbd..2b6b782 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -46,8 +46,8 @@ OutputSurface::OutputSurface( context_provider_(context_provider), device_scale_factor_(-1), 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) @@ -55,8 +55,8 @@ OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) software_device_(software_device.Pass()), device_scale_factor_(-1), external_stencil_test_enabled_(false), - weak_ptr_factory_(this), - gpu_latency_history_(kGpuLatencyHistorySize) { + gpu_latency_history_(kGpuLatencyHistorySize), + weak_ptr_factory_(this) { } OutputSurface::OutputSurface( @@ -67,8 +67,8 @@ OutputSurface::OutputSurface( software_device_(software_device.Pass()), device_scale_factor_(-1), 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, diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h index d3eca54..e041aa0 100644 --- a/cc/output/output_surface.h +++ b/cc/output/output_surface.h @@ -178,12 +178,12 @@ class CC_EXPORT OutputSurface { bool external_stencil_test_enabled_; - base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; - std::deque<unsigned> available_gpu_latency_query_ids_; std::deque<unsigned> pending_gpu_latency_query_ids_; RollingTimeDeltaHistory gpu_latency_history_; + base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(OutputSurface); }; diff --git a/cc/resources/gpu_raster_worker_pool.h b/cc/resources/gpu_raster_worker_pool.h index 61c8e55..71486c0 100644 --- a/cc/resources/gpu_raster_worker_pool.h +++ b/cc/resources/gpu_raster_worker_pool.h @@ -60,8 +60,6 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, bool raster_tasks_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_required_for_activation_finished_task_; @@ -70,6 +68,8 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, TaskGraph graph_; Task::Vector completed_tasks_; + base::WeakPtrFactory<GpuRasterWorkerPool> raster_finished_weak_ptr_factory_; + base::WeakPtrFactory<GpuRasterWorkerPool> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(GpuRasterWorkerPool); |