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

Unified Diff: cc/resources/scoped_ui_resource.cc

Issue 2322943003: cc: Move UI Resource management out of LayerTreeHost. (Closed)
Patch Set: virtual dtor Created 4 years, 3 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/scoped_ui_resource.h ('k') | cc/resources/ui_resource_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/scoped_ui_resource.cc
diff --git a/cc/resources/scoped_ui_resource.cc b/cc/resources/scoped_ui_resource.cc
index 4ac336d2fe7dd434b12b3979f97395cfaaea676c..dfac1ea019aca2830df306ff117ef900cda63502 100644
--- a/cc/resources/scoped_ui_resource.cc
+++ b/cc/resources/scoped_ui_resource.cc
@@ -6,29 +6,29 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
-#include "cc/trees/layer_tree_host.h"
+#include "cc/resources/ui_resource_manager.h"
namespace cc {
std::unique_ptr<ScopedUIResource> ScopedUIResource::Create(
- LayerTreeHost* host,
+ UIResourceManager* ui_resource_manager,
const UIResourceBitmap& bitmap) {
- return base::WrapUnique(new ScopedUIResource(host, bitmap));
+ return base::WrapUnique(new ScopedUIResource(ui_resource_manager, bitmap));
}
-ScopedUIResource::ScopedUIResource(LayerTreeHost* host,
+ScopedUIResource::ScopedUIResource(UIResourceManager* ui_resource_manager,
const UIResourceBitmap& bitmap)
- : bitmap_(bitmap), host_(host) {
- DCHECK(host_);
- id_ = host_->CreateUIResource(this);
+ : bitmap_(bitmap), ui_resource_manager_(ui_resource_manager) {
+ DCHECK(ui_resource_manager_);
+ id_ = ui_resource_manager_->CreateUIResource(this);
}
// User must make sure that host is still valid before this object goes out of
// scope.
ScopedUIResource::~ScopedUIResource() {
if (id_) {
- DCHECK(host_);
- host_->DeleteUIResource(id_);
+ DCHECK(ui_resource_manager_);
+ ui_resource_manager_->DeleteUIResource(id_);
}
}
« no previous file with comments | « cc/resources/scoped_ui_resource.h ('k') | cc/resources/ui_resource_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698