• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 PDFium 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.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #include "xfa/fxfa/parser/cxfa_nodeowner.h"
8 
9 #include <utility>
10 
11 #include "xfa/fxfa/parser/cxfa_node.h"
12 
13 CXFA_NodeOwner::CXFA_NodeOwner() = default;
14 
~CXFA_NodeOwner()15 CXFA_NodeOwner::~CXFA_NodeOwner() {
16   is_being_destroyed_ = true;
17 }
18 
AddOwnedNode(std::unique_ptr<CXFA_Node> node)19 CXFA_Node* CXFA_NodeOwner::AddOwnedNode(std::unique_ptr<CXFA_Node> node) {
20   if (!node)
21     return nullptr;
22 
23   CXFA_Node* ret = node.get();
24   nodes_.push_back(std::move(node));
25   return ret;
26 }
27