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

Side by Side Diff: fpdfsdk/src/fpdf_dataavail.cpp

Issue 873523002: Use IPDF_DataAvail interface to hide CPDF_DataAvail. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 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 | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.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 #include "../include/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fpdf_dataavail.h" 8 #include "../include/fpdf_dataavail.h"
9 9
10 extern void ProcessParseError(FX_DWORD err_code); 10 extern void ProcessParseError(FX_DWORD err_code);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 CFPDF_DataAvail() 83 CFPDF_DataAvail()
84 { 84 {
85 m_pDataAvail = NULL; 85 m_pDataAvail = NULL;
86 } 86 }
87 87
88 ~CFPDF_DataAvail() 88 ~CFPDF_DataAvail()
89 { 89 {
90 if (m_pDataAvail) delete m_pDataAvail; 90 if (m_pDataAvail) delete m_pDataAvail;
91 } 91 }
92 92
93 » CPDF_DataAvail*»» » m_pDataAvail; 93 » IPDF_DataAvail*»» » m_pDataAvail;
94 CFPDF_FileAvailWrap m_FileAvail; 94 CFPDF_FileAvailWrap m_FileAvail;
95 CFPDF_FileAccessWrap m_FileRead; 95 CFPDF_FileAccessWrap m_FileRead;
96 }; 96 };
97 97
98 DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FIL EACCESS* file) 98 DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FIL EACCESS* file)
99 { 99 {
100 CFPDF_DataAvail* pAvail = FX_NEW CFPDF_DataAvail; 100 CFPDF_DataAvail* pAvail = FX_NEW CFPDF_DataAvail;
101 pAvail->m_FileAvail.Set(file_avail); 101 pAvail->m_FileAvail.Set(file_avail);
102 pAvail->m_FileRead.Set(file); 102 pAvail->m_FileRead.Set(file);
103 » pAvail->m_pDataAvail = FX_NEW CPDF_DataAvail(&pAvail->m_FileAvail, &pAva il->m_FileRead); 103 » pAvail->m_pDataAvail = IPDF_DataAvail::Create(&pAvail->m_FileAvail, &pAv ail->m_FileRead);
104 return pAvail; 104 return pAvail;
105 } 105 }
106 106
107 DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail) 107 DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail)
108 { 108 {
109 if (avail == NULL) return; 109 if (avail == NULL) return;
110 delete (CFPDF_DataAvail*)avail; 110 delete (CFPDF_DataAvail*)avail;
111 } 111 }
112 112
113 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* h ints) 113 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* h ints)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 CFPDF_DownloadHintsWrap hints_wrap(hints); 156 CFPDF_DownloadHintsWrap hints_wrap(hints);
157 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap) ; 157 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap) ;
158 } 158 }
159 159
160 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) 160 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail)
161 { 161 {
162 if (avail == NULL) return -1; 162 if (avail == NULL) return -1;
163 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); 163 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
164 164
165 } 165 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698