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

Side by Side Diff: pdf/pdfium/pdfium_engine.h

Issue 863043003: PDF: Add a bunch of DCHECKs to make sure we do not go out of bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | pdf/pdfium/pdfium_engine.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_
6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 // The link currently under the cursor. 684 // The link currently under the cursor.
685 std::string link_under_cursor_; 685 std::string link_under_cursor_;
686 686
687 // Pending progressive paints. 687 // Pending progressive paints.
688 struct ProgressivePaint { 688 struct ProgressivePaint {
689 pp::Rect rect; // In screen coordinates. 689 pp::Rect rect; // In screen coordinates.
690 FPDF_BITMAP bitmap; 690 FPDF_BITMAP bitmap;
691 int page_index; 691 int page_index;
692 // Temporary used to figure out if in a series of Paint() calls whether this 692 // Temporary used to figure out if in a series of Paint() calls whether this
693 // pending paint was updated or not. 693 // pending paint was updated or not.
694 int painted_; 694 bool painted_;
695 }; 695 };
696 std::vector<ProgressivePaint> progressive_paints_; 696 std::vector<ProgressivePaint> progressive_paints_;
697 697
698 // Keeps track of when we started the last progressive paint, so that in our 698 // Keeps track of when we started the last progressive paint, so that in our
699 // callback we can determine if we need to pause. 699 // callback we can determine if we need to pause.
700 base::Time last_progressive_start_time_; 700 base::Time last_progressive_start_time_;
701 701
702 // The timeout to use for the current progressive paint. 702 // The timeout to use for the current progressive paint.
703 int progressive_paint_timeout_; 703 int progressive_paint_timeout_;
704 704
705 // Shadow matrix for generating the page shadow bitmap. 705 // Shadow matrix for generating the page shadow bitmap.
706 scoped_ptr<ShadowMatrix> page_shadow_; 706 scoped_ptr<ShadowMatrix> page_shadow_;
707 707
708 // Set to true if the user is being prompted for their password. Will be set 708 // Set to true if the user is being prompted for their password. Will be set
709 // to false after the user finishes getting their password. 709 // to false after the user finishes getting their password.
710 bool getting_password_; 710 bool getting_password_;
711
712 DISALLOW_COPY_AND_ASSIGN(PDFiumEngine);
711 }; 713 };
712 714
713 // Create a local variable of this when calling PDFium functions which can call 715 // Create a local variable of this when calling PDFium functions which can call
714 // our global callback when an unsupported feature is reached. 716 // our global callback when an unsupported feature is reached.
715 class ScopedUnsupportedFeature { 717 class ScopedUnsupportedFeature {
716 public: 718 public:
717 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); 719 explicit ScopedUnsupportedFeature(PDFiumEngine* engine);
718 ~ScopedUnsupportedFeature(); 720 ~ScopedUnsupportedFeature();
719 private: 721 private:
720 PDFiumEngine* engine_; 722 PDFiumEngine* engine_;
(...skipping 24 matching lines...) Expand all
745 747
746 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. 748 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details.
747 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, 749 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
748 int pdf_buffer_size, int page_number, 750 int pdf_buffer_size, int page_number,
749 double* width, double* height); 751 double* width, double* height);
750 }; 752 };
751 753
752 } // namespace chrome_pdf 754 } // namespace chrome_pdf
753 755
754 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 756 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | pdf/pdfium/pdfium_engine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698