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

Unified Diff: cc/resources/tile_manager.h

Issue 1127253002: Revert "cc: Remove Tile refcounting and RefCountedManaged." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tile_manager.h
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index b27fa8642999e14dcfbedb153a6edcac3bc616c1..087778a49fffb0359dfd0fddf9e6d812c8126543 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -14,6 +14,7 @@
#include "base/containers/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "cc/base/ref_counted_managed.h"
#include "cc/base/unique_notifier.h"
#include "cc/resources/eviction_tile_priority_queue.h"
#include "cc/resources/memory_history.h"
@@ -85,7 +86,8 @@ RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats);
// should no longer have any memory assigned to them. Tile objects are "owned"
// by layers; they automatically register with the manager when they are
// created, and unregister from the manager when they are deleted.
-class CC_EXPORT TileManager : public TileTaskRunnerClient {
+class CC_EXPORT TileManager : public TileTaskRunnerClient,
+ public RefCountedManager<Tile> {
public:
enum NamedTaskSet {
REQUIRED_FOR_ACTIVATION,
@@ -116,13 +118,13 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient {
void UpdateVisibleTiles(const GlobalStateThatImpactsTilePriority& state);
- ScopedTilePtr CreateTile(RasterSource* raster_source,
- const gfx::Size& desired_texture_size,
- const gfx::Rect& content_rect,
- float contents_scale,
- int layer_id,
- int source_frame_number,
- int flags);
+ scoped_refptr<Tile> CreateTile(RasterSource* raster_source,
+ const gfx::Size& desired_texture_size,
+ const gfx::Rect& content_rect,
+ float contents_scale,
+ int layer_id,
+ int source_frame_number,
+ int flags);
bool IsReadyToActivate() const;
bool IsReadyToDraw() const;
@@ -190,9 +192,9 @@ class CC_EXPORT TileManager : public TileTaskRunnerClient {
void FreeResourcesForReleasedTiles();
void CleanUpReleasedTiles();
+ // Overriden from RefCountedManager<Tile>:
friend class Tile;
- // Virtual for testing.
- virtual void Release(Tile* tile);
+ void Release(Tile* tile) override;
// Overriden from TileTaskRunnerClient:
void DidFinishRunningTileTasks(TaskSet task_set) override;
« no previous file with comments | « cc/resources/tile.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698