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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 457873003: PDF: Add some CHECKS to help debug a crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a check Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index e8c164b03ac0dd2f8066ef7b385e59a8803d1449..606180a4ac98977df3c3b3754e283c62aeb185ff 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());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698