Non-SFI mode: Clean up macros of base/ and ipc/ libraries for nacl_helper_nonsfi.
[chromium-blink-merge.git] / ui / compositor / layer_tree_owner.h
blob8b753555b4739150bc90ed573b5a7882f5c34dea
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_COMPOSITOR_LAYER_TREE_OWNER_H_
6 #define UI_COMPOSITOR_LAYER_TREE_OWNER_H_
8 #include "base/basictypes.h"
9 #include "ui/compositor/compositor_export.h"
11 namespace ui {
13 class Layer;
15 // Scoping object that owns a Layer and all its descendants.
16 class COMPOSITOR_EXPORT LayerTreeOwner {
17 public:
18 explicit LayerTreeOwner(Layer* root);
19 ~LayerTreeOwner();
21 Layer* release() WARN_UNUSED_RESULT {
22 Layer* root = root_;
23 root_ = NULL;
24 return root;
27 Layer* root() { return root_; }
28 const Layer* root() const { return root_; }
30 private:
31 Layer* root_;
33 DISALLOW_COPY_AND_ASSIGN(LayerTreeOwner);
36 } // namespace
38 #endif // UI_COMPOSITOR_LAYER_TREE_OWNER_H_