| Index: cc/surfaces/surface_factory.cc
|
| diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
|
| index 345171a0f31f76873a83c1c1d01071a38f23ef4e..27c6f6cd50307fee33e8bf4e8e60ce888e2b1b80 100644
|
| --- a/cc/surfaces/surface_factory.cc
|
| +++ b/cc/surfaces/surface_factory.cc
|
| @@ -15,12 +15,17 @@
|
| #include "ui/gfx/geometry/size.h"
|
|
|
| namespace cc {
|
| -SurfaceFactory::SurfaceFactory(SurfaceManager* manager,
|
| +
|
| +SurfaceFactory::SurfaceFactory(uint32_t client_id,
|
| + SurfaceManager* manager,
|
| SurfaceFactoryClient* client)
|
| - : manager_(manager),
|
| + : client_id_(client_id),
|
| + parent_client_id_(0),
|
| + manager_(manager),
|
| client_(client),
|
| holder_(client),
|
| needs_sync_points_(true) {
|
| + manager_->RegisterClient(client_id_, client);
|
| }
|
|
|
| SurfaceFactory::~SurfaceFactory() {
|
| @@ -29,6 +34,23 @@ SurfaceFactory::~SurfaceFactory() {
|
| << " entries in map on destruction.";
|
| }
|
| DestroyAll();
|
| + if (manager_) {
|
| + if (parent_client_id_) {
|
| + manager_->UnregisterSurfaceNamespaceHierarchy(parent_client_id_,
|
| + client_id_);
|
| + }
|
| + manager_->UnregisterClient(client_id_);
|
| + }
|
| +}
|
| +
|
| +void SurfaceFactory::SetParent(uint32_t parent_client_id) {
|
| + if (parent_client_id_) {
|
| + manager_->UnregisterSurfaceNamespaceHierarchy(parent_client_id_,
|
| + client_id_);
|
| + }
|
| + parent_client_id_ = parent_client_id;
|
| + if (parent_client_id_)
|
| + manager_->RegisterSurfaceNamespaceHierarchy(parent_client_id_, client_id_);
|
| }
|
|
|
| void SurfaceFactory::DestroyAll() {
|
|
|