summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 09:10:46 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 09:12:20 +0000
commit22587822132c5773bd934309245287f3d705826b (patch)
treed35e75e4f38c621164eb74ed3c1a6cf2fbbf9bfa /pdf
parent130e92a773ab408e79a7488af624a4c7984c775f (diff)
downloadchromium_src-22587822132c5773bd934309245287f3d705826b.zip
chromium_src-22587822132c5773bd934309245287f3d705826b.tar.gz
chromium_src-22587822132c5773bd934309245287f3d705826b.tar.bz2
PDF: Add some CHECKS to help debug a crash.
BUG=402035 Review URL: https://codereview.chromium.org/457873003 Cr-Commit-Position: refs/heads/master@{#289822} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdfium/pdfium_engine.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index e8c164b..606180a 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1964,6 +1964,8 @@ std::string PDFiumEngine::GetPageAsJSON(int index) {
if (index < 0 || static_cast<size_t>(index) > pages_.size() - 1)
return "{}";
+ // TODO(thestig) Remove after debugging http://crbug.com/402035
+ CHECK(pages_[index]);
scoped_ptr<base::Value> node(
pages_[index]->GetAccessibleContentAsValue(current_rotation_));
std::string page_json;
@@ -2021,6 +2023,8 @@ void PDFiumEngine::AppendBlankPages(int num_pages) {
page_rect.height() * kPointsPerInch / kPixelsPerInch;
FPDFPage_New(doc_, i, width_in_points, height_in_points);
pages_.push_back(new PDFiumPage(this, i, page_rect, true));
+ // TODO(thestig) Remove after debugging http://crbug.com/402035
+ CHECK(pages_.back());
}
CalculateVisiblePages();
@@ -2188,6 +2192,8 @@ void PDFiumEngine::LoadPageInfo(bool reload) {
pages_[i]->set_rect(page_rect);
} else {
pages_.push_back(new PDFiumPage(this, i, page_rect, doc_complete));
+ // TODO(thestig) Remove after debugging http://crbug.com/402035
+ CHECK(pages_.back());
}
}