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

Side by Side Diff: xfa/fxfa/xfa_ffapp.h

Issue 2576893002: Return unique_ptr from CXFA_FFApp::CreateDoc. (Closed)
Patch Set: Created 4 years 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 | « xfa/fxfa/app/xfa_ffapp.cpp ('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 #ifndef XFA_FXFA_XFA_FFAPP_H_ 7 #ifndef XFA_FXFA_XFA_FFAPP_H_
8 #define XFA_FXFA_XFA_FFAPP_H_ 8 #define XFA_FXFA_XFA_FFAPP_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 17 matching lines...) Expand all
28 // Layering prevents fxcrt from knowing about CPDF_Streams; this could go 28 // Layering prevents fxcrt from knowing about CPDF_Streams; this could go
29 // in fpdfsdk, but it is XFA-Only. 29 // in fpdfsdk, but it is XFA-Only.
30 CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream( 30 CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(
31 const std::vector<CPDF_Stream*>& streams); 31 const std::vector<CPDF_Stream*>& streams);
32 32
33 class CXFA_FFApp { 33 class CXFA_FFApp {
34 public: 34 public:
35 explicit CXFA_FFApp(IXFA_AppProvider* pProvider); 35 explicit CXFA_FFApp(IXFA_AppProvider* pProvider);
36 ~CXFA_FFApp(); 36 ~CXFA_FFApp();
37 37
38 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment, 38 std::unique_ptr<CXFA_FFDoc> CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
39 const CFX_RetainPtr<IFX_SeekableReadStream>& pStream); 39 CPDF_Document* pPDFDoc);
40 CXFA_FFDoc* CreateDoc(IXFA_DocEnvironment* pDocEnvironment,
41 CPDF_Document* pPDFDoc);
42 void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr); 40 void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr);
43 41
44 CXFA_FFDocHandler* GetDocHandler(); 42 CXFA_FFDocHandler* GetDocHandler();
45 CXFA_FWLAdapterWidgetMgr* GetWidgetMgr(CFWL_WidgetMgrDelegate* pDelegate); 43 CXFA_FWLAdapterWidgetMgr* GetWidgetMgr(CFWL_WidgetMgrDelegate* pDelegate);
46 CFGAS_FontMgr* GetFDEFontMgr(); 44 CFGAS_FontMgr* GetFDEFontMgr();
47 CXFA_FWLTheme* GetFWLTheme(); 45 CXFA_FWLTheme* GetFWLTheme();
48 46
49 IXFA_AppProvider* GetAppProvider() const { return m_pProvider; } 47 IXFA_AppProvider* GetAppProvider() const { return m_pProvider; }
50 const CFWL_App* GetFWLApp() const { return m_pFWLApp.get(); } 48 const CFWL_App* GetFWLApp() const { return m_pFWLApp.get(); }
51 IFWL_AdapterTimerMgr* GetTimerMgr() const; 49 IFWL_AdapterTimerMgr* GetTimerMgr() const;
(...skipping 27 matching lines...) Expand all
79 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; 77 std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr;
80 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned. 78 CFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; // not owned.
81 79
82 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former 80 // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former
83 // may refers to theme manager and the latter refers to font manager. 81 // may refers to theme manager and the latter refers to font manager.
84 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme; 82 std::unique_ptr<CXFA_FWLTheme> m_pFWLTheme;
85 std::unique_ptr<CFWL_App> m_pFWLApp; 83 std::unique_ptr<CFWL_App> m_pFWLApp;
86 }; 84 };
87 85
88 #endif // XFA_FXFA_XFA_FFAPP_H_ 86 #endif // XFA_FXFA_XFA_FFAPP_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffapp.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698