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

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp

Issue 1861403002: Rename FX_SAFE_DWORD to FX_SAFE_UINT32 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_data_avail.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_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include <limits.h> 9 #include <limits.h>
10 10
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 m_InternalStage = STAGE_PARSE; 790 m_InternalStage = STAGE_PARSE;
791 m_CurrentOffset = 0; 791 m_CurrentOffset = 0;
792 } 792 }
793 793
794 void CPDF_ContentParser::Continue(IFX_Pause* pPause) { 794 void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
795 int steps = 0; 795 int steps = 0;
796 while (m_Status == ToBeContinued) { 796 while (m_Status == ToBeContinued) {
797 if (m_InternalStage == STAGE_GETCONTENT) { 797 if (m_InternalStage == STAGE_GETCONTENT) {
798 if (m_CurrentOffset == m_nStreams) { 798 if (m_CurrentOffset == m_nStreams) {
799 if (!m_StreamArray.empty()) { 799 if (!m_StreamArray.empty()) {
800 FX_SAFE_DWORD safeSize = 0; 800 FX_SAFE_UINT32 safeSize = 0;
801 for (const auto& stream : m_StreamArray) { 801 for (const auto& stream : m_StreamArray) {
802 safeSize += stream->GetSize(); 802 safeSize += stream->GetSize();
803 safeSize += 1; 803 safeSize += 1;
804 } 804 }
805 if (!safeSize.IsValid()) { 805 if (!safeSize.IsValid()) {
806 m_Status = Done; 806 m_Status = Done;
807 return; 807 return;
808 } 808 }
809 m_Size = safeSize.ValueOrDie(); 809 m_Size = safeSize.ValueOrDie();
810 m_pData = FX_Alloc(uint8_t, m_Size); 810 m_pData = FX_Alloc(uint8_t, m_Size);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 } 885 }
886 m_Status = Done; 886 m_Status = Done;
887 return; 887 return;
888 } 888 }
889 steps++; 889 steps++;
890 if (pPause && pPause->NeedToPauseNow()) { 890 if (pPause && pPause->NeedToPauseNow()) {
891 break; 891 break;
892 } 892 }
893 } 893 }
894 } 894 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698