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

Side by Side Diff: xfa/fde/xml/cfx_saxreader.cpp

Issue 2386273004: Add ptr_util.h from base until std::make_unique<> available (Closed)
Patch Set: 2016 Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « third_party/base/ptr_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fde/xml/cfx_saxreader.h" 7 #include "xfa/fde/xml/cfx_saxreader.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
11 11
12 #include "third_party/base/ptr_util.h"
12 #include "xfa/fxfa/xfa_checksum.h" 13 #include "xfa/fxfa/xfa_checksum.h"
13 14
14 enum class CFX_SaxMode { 15 enum class CFX_SaxMode {
15 Text = 0, 16 Text = 0,
16 NodeStart, 17 NodeStart,
17 DeclOrComment, 18 DeclOrComment,
18 DeclNode, 19 DeclNode,
19 Comment, 20 Comment,
20 CommentContent, 21 CommentContent,
21 TagName, 22 TagName,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 m_SkipChar = 0; 153 m_SkipChar = 0;
153 m_iDataLength = 0; 154 m_iDataLength = 0;
154 m_iEntityStart = -1; 155 m_iEntityStart = -1;
155 m_iNameLength = 0; 156 m_iNameLength = 0;
156 m_iDataPos = 0; 157 m_iDataPos = 0;
157 delete m_pCommentContext; 158 delete m_pCommentContext;
158 m_pCommentContext = nullptr; 159 m_pCommentContext = nullptr;
159 } 160 }
160 161
161 void CFX_SAXReader::Push() { 162 void CFX_SAXReader::Push() {
162 std::unique_ptr<CFX_SAXItem> pNew(WrapUnique(new CFX_SAXItem(++m_dwItemID))); 163 std::unique_ptr<CFX_SAXItem> pNew =
164 pdfium::MakeUnique<CFX_SAXItem>(++m_dwItemID);
163 if (!m_Stack.empty()) 165 if (!m_Stack.empty())
164 pNew->m_bSkip = m_Stack.top()->m_bSkip; 166 pNew->m_bSkip = m_Stack.top()->m_bSkip;
165 m_Stack.push(std::move(pNew)); 167 m_Stack.push(std::move(pNew));
166 } 168 }
167 169
168 void CFX_SAXReader::Pop() { 170 void CFX_SAXReader::Pop() {
169 if (!m_Stack.empty()) 171 if (!m_Stack.empty())
170 m_Stack.pop(); 172 m_Stack.pop();
171 } 173 }
172 174
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 CFX_SAXItem* pItem = GetCurrentItem(); 727 CFX_SAXItem* pItem = GetCurrentItem();
726 if (!pItem) 728 if (!pItem)
727 return; 729 return;
728 730
729 pItem->m_bSkip = TRUE; 731 pItem->m_bSkip = TRUE;
730 } 732 }
731 733
732 void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) { 734 void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) {
733 m_pHandler = pHandler; 735 m_pHandler = pHandler;
734 } 736 }
OLDNEW
« no previous file with comments | « third_party/base/ptr_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698