Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: cc/tile_manager.cc

Issue 12079028: cc: Fix RasterWorkerPool shutdown crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/raster_worker_pool.cc ('K') | « cc/raster_worker_pool.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/tile_manager.h" 5 #include "cc/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 TileManagerClient* client, 119 TileManagerClient* client,
120 ResourceProvider* resource_provider, 120 ResourceProvider* resource_provider,
121 size_t num_raster_threads) 121 size_t num_raster_threads)
122 : client_(client), 122 : client_(client),
123 resource_pool_(ResourcePool::Create(resource_provider)), 123 resource_pool_(ResourcePool::Create(resource_provider)),
124 raster_worker_pool_(RasterWorkerPool::Create(num_raster_threads)), 124 raster_worker_pool_(RasterWorkerPool::Create(num_raster_threads)),
125 manage_tiles_pending_(false), 125 manage_tiles_pending_(false),
126 manage_tiles_call_count_(0), 126 manage_tiles_call_count_(0),
127 bytes_pending_set_pixels_(0), 127 bytes_pending_set_pixels_(0),
128 ever_exceeded_memory_budget_(false) { 128 ever_exceeded_memory_budget_(false) {
129 bool worker_pool_is_running = raster_worker_pool_->Start();
130 CHECK(worker_pool_is_running);
131
129 for (int i = 0; i < NUM_STATES; ++i) { 132 for (int i = 0; i < NUM_STATES; ++i) {
130 for (int j = 0; j < NUM_TREES; ++j) { 133 for (int j = 0; j < NUM_TREES; ++j) {
131 for (int k = 0; k < NUM_BINS; ++k) 134 for (int k = 0; k < NUM_BINS; ++k)
132 raster_state_count_[i][j][k] = 0; 135 raster_state_count_[i][j][k] = 0;
133 } 136 }
134 } 137 }
135 } 138 }
136 139
137 TileManager::~TileManager() { 140 TileManager::~TileManager() {
138 // Reset global state and manage. This should cause 141 // Reset global state and manage. This should cause
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 --raster_state_count_[mts.raster_state][tree][mts.tree_bin[tree]]; 750 --raster_state_count_[mts.raster_state][tree][mts.tree_bin[tree]];
748 DCHECK_GE(raster_state_count_[mts.raster_state][tree][mts.tree_bin[tree]], 0); 751 DCHECK_GE(raster_state_count_[mts.raster_state][tree][mts.tree_bin[tree]], 0);
749 752
750 // Increment count for new bin. 753 // Increment count for new bin.
751 ++raster_state_count_[mts.raster_state][tree][bin]; 754 ++raster_state_count_[mts.raster_state][tree][bin];
752 755
753 mts.tree_bin[tree] = bin; 756 mts.tree_bin[tree] = bin;
754 } 757 }
755 758
756 } // namespace cc 759 } // namespace cc
OLDNEW
« cc/raster_worker_pool.cc ('K') | « cc/raster_worker_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698