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

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

Issue 1288393004: Merge to XFA: Use override in more classes in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: self review 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
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fsdk_mgr.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/include/fpdfapi/fpdf_module.h" 7 #include "../../core/include/fpdfapi/fpdf_module.h"
8 #include "../../core/include/fxcodec/fx_codec.h" 8 #include "../../core/include/fxcodec/fx_codec.h"
9 #include "../../core/include/fxcrt/fx_safe_types.h" 9 #include "../../core/include/fxcrt/fx_safe_types.h"
10 #include "../../public/fpdf_ext.h" 10 #include "../../public/fpdf_ext.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 pdfium::base::checked_cast<FX_FILESIZE, size_t>(size); 316 pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
317 newPos += offset; 317 newPos += offset;
318 if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) { 318 if (!newPos.IsValid() || newPos.ValueOrDie() > (FX_DWORD)m_size) {
319 return FALSE; 319 return FALSE;
320 } 320 }
321 FXSYS_memcpy(buffer, m_pBuf + offset, size); 321 FXSYS_memcpy(buffer, m_pBuf + offset, size);
322 return TRUE; 322 return TRUE;
323 } 323 }
324 324
325 private: 325 private:
326 ~CMemFile() override {}
327
326 uint8_t* m_pBuf; 328 uint8_t* m_pBuf;
327 FX_FILESIZE m_size; 329 FX_FILESIZE m_size;
328 }; 330 };
329 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, 331 DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
330 int size, 332 int size,
331 FPDF_BYTESTRING password) { 333 FPDF_BYTESTRING password) {
332 CPDF_Parser* pParser = new CPDF_Parser; 334 CPDF_Parser* pParser = new CPDF_Parser;
333 pParser->SetPassword(password); 335 pParser->SetPassword(password);
334 CMemFile* pMemFile = new CMemFile((uint8_t*)data_buf, size); 336 CMemFile* pMemFile = new CMemFile((uint8_t*)data_buf, size);
335 FX_DWORD err_code = pParser->StartParse(pMemFile); 337 FX_DWORD err_code = pParser->StartParse(pMemFile);
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 if (!buffer) { 1094 if (!buffer) {
1093 *buflen = len; 1095 *buflen = len;
1094 } else if (*buflen >= len) { 1096 } else if (*buflen >= len) {
1095 memcpy(buffer, utf16Name.c_str(), len); 1097 memcpy(buffer, utf16Name.c_str(), len);
1096 *buflen = len; 1098 *buflen = len;
1097 } else { 1099 } else {
1098 *buflen = -1; 1100 *buflen = -1;
1099 } 1101 }
1100 return (FPDF_DEST)pDestObj; 1102 return (FPDF_DEST)pDestObj;
1101 } 1103 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698