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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 918953002: Fix for PDFs with lots of named destinations take a long time to load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 10 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 | « pdf/pdfium/pdfium_engine.h ('k') | 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 51e5676e92085951edd10adf68d2f94bbb07e4ed..b179e1efbc5397921c6f42183a51a4f4f967e78b 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2389,33 +2389,6 @@ int PDFiumEngine::GetNamedDestinationPage(const std::string& destination) {
return dest ? FPDFDest_GetPageIndex(doc_, dest) : -1;
}
-pp::VarDictionary PDFiumEngine::GetNamedDestinations() {
- pp::VarDictionary named_destinations;
- for (unsigned long i = 0; i < FPDF_CountNamedDests(doc_); i++) {
- base::string16 name;
- long buffer_bytes;
- FPDF_GetNamedDest(doc_, i, NULL, buffer_bytes);
- size_t name_length = base::checked_cast<size_t>(buffer_bytes) /
- sizeof(base::string16::value_type);
- if (name_length > 0) {
- PDFiumAPIStringBufferAdapter<base::string16> api_string_adapter(
- &name, name_length, true);
- FPDF_DEST dest = FPDF_GetNamedDest(doc_, i, api_string_adapter.GetData(),
- buffer_bytes);
- api_string_adapter.Close(name_length);
- if (dest) {
- std::string named_dest = base::UTF16ToUTF8(name);
- int page_number = GetNamedDestinationPage(named_dest);
- if (page_number >= 0) {
- named_destinations.Set(pp::Var(named_dest.c_str()),
- pp::Var(page_number));
- }
- }
- }
- }
- return named_destinations;
-}
-
int PDFiumEngine::GetFirstVisiblePage() {
CalculateVisiblePages();
return first_visible_page_;
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698