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

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

Issue 1299963002: Extern in .cpp files is a code smell. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 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
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/include/fxcodec/fx_codec.h" 7 #include "../../core/include/fxcodec/fx_codec.h"
8 #include "../../core/include/fxcrt/fx_safe_types.h" 8 #include "../../core/include/fxcrt/fx_safe_types.h"
9 #include "../../public/fpdf_ext.h" 9 #include "../../public/fpdf_ext.h"
10 #include "../../public/fpdf_progressive.h" 10 #include "../../public/fpdf_progressive.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 FX_DWORD err_code = pParser->StartParse(pFileAccess); 176 FX_DWORD err_code = pParser->StartParse(pFileAccess);
177 if (err_code) { 177 if (err_code) {
178 delete pParser; 178 delete pParser;
179 ProcessParseError(err_code); 179 ProcessParseError(err_code);
180 return NULL; 180 return NULL;
181 } 181 }
182 return pParser->GetDocument(); 182 return pParser->GetDocument();
183 } 183 }
184 184
185 extern void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code);
186
187 class CMemFile final : public IFX_FileRead { 185 class CMemFile final : public IFX_FileRead {
188 public: 186 public:
189 CMemFile(uint8_t* pBuf, FX_FILESIZE size) : m_pBuf(pBuf), m_size(size) {} 187 CMemFile(uint8_t* pBuf, FX_FILESIZE size) : m_pBuf(pBuf), m_size(size) {}
190 188
191 virtual void Release() { delete this; } 189 virtual void Release() { delete this; }
192 virtual FX_FILESIZE GetSize() { return m_size; } 190 virtual FX_FILESIZE GetSize() { return m_size; }
193 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { 191 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) {
194 if (offset < 0) { 192 if (offset < 0) {
195 return FALSE; 193 return FALSE;
196 } 194 }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 if (!buffer) { 913 if (!buffer) {
916 *buflen = len; 914 *buflen = len;
917 } else if (*buflen >= len) { 915 } else if (*buflen >= len) {
918 memcpy(buffer, utf16Name.c_str(), len); 916 memcpy(buffer, utf16Name.c_str(), len);
919 *buflen = len; 917 *buflen = len;
920 } else { 918 } else {
921 *buflen = -1; 919 *buflen = -1;
922 } 920 }
923 return (FPDF_DEST)pDestObj; 921 return (FPDF_DEST)pDestObj;
924 } 922 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698