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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2275773003: Flip document and parser ownership (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@private_parser
Patch Set: Rebase to master 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | 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 "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 // This page is a leaf node. 476 // This page is a leaf node.
477 count++; 477 count++;
478 } 478 }
479 } 479 }
480 pPages->SetAtInteger("Count", count); 480 pPages->SetAtInteger("Count", count);
481 return count; 481 return count;
482 } 482 }
483 483
484 } // namespace 484 } // namespace
485 485
486 CPDF_Document::CPDF_Document(CPDF_Parser* pParser) 486 CPDF_Document::CPDF_Document(std::unique_ptr<CPDF_Parser> pParser)
487 : CPDF_IndirectObjectHolder(), 487 : CPDF_IndirectObjectHolder(),
488 m_pParser(pParser), 488 m_pParser(std::move(pParser)),
489 m_pRootDict(nullptr), 489 m_pRootDict(nullptr),
490 m_pInfoDict(nullptr), 490 m_pInfoDict(nullptr),
491 m_bLinearized(false), 491 m_bLinearized(false),
492 m_iFirstPageNo(0), 492 m_iFirstPageNo(0),
493 m_dwFirstPageObjNum(0), 493 m_dwFirstPageObjNum(0),
494 m_pDocPage(new CPDF_DocPageData(this)), 494 m_pDocPage(new CPDF_DocPageData(this)),
495 m_pDocRender(new CPDF_DocRenderData(this)) { 495 m_pDocRender(new CPDF_DocRenderData(this)) {
496 if (pParser) 496 if (pParser)
497 SetLastObjNum(m_pParser->GetLastObjNum()); 497 SetLastObjNum(m_pParser->GetLastObjNum());
498 } 498 }
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 } 1451 }
1452 } 1452 }
1453 pFontDesc->SetAtInteger("StemV", fStemV); 1453 pFontDesc->SetAtInteger("StemV", fStemV);
1454 AddIndirectObject(pFontDesc); 1454 AddIndirectObject(pFontDesc);
1455 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc); 1455 pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
1456 CFRelease(traits); 1456 CFRelease(traits);
1457 CFRelease(languages); 1457 CFRelease(languages);
1458 return LoadFont(pBaseDict); 1458 return LoadFont(pBaseDict);
1459 } 1459 }
1460 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 1460 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698