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

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

Issue 2837663002: Cleanup PDF plugin code. (Closed)
Patch Set: comments Created 3 years, 7 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 | « pdf/pdf_engine.h ('k') | no next file » | no next file with comments »
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 #include "pdf/pdfium/pdfium_engine.h" 5 #include "pdf/pdfium/pdfium_engine.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 } 652 }
653 653
654 void ShutdownSDK() { 654 void ShutdownSDK() {
655 FPDF_DestroyLibrary(); 655 FPDF_DestroyLibrary();
656 #if !defined(OS_LINUX) 656 #if !defined(OS_LINUX)
657 delete g_font_info; 657 delete g_font_info;
658 #endif 658 #endif
659 TearDownV8(); 659 TearDownV8();
660 } 660 }
661 661
662 PDFEngine* PDFEngine::Create(PDFEngine::Client* client) { 662 std::unique_ptr<PDFEngine> PDFEngine::Create(PDFEngine::Client* client) {
663 return new PDFiumEngine(client); 663 return base::MakeUnique<PDFiumEngine>(client);
664 } 664 }
665 665
666 PDFiumEngine::PDFiumEngine(PDFEngine::Client* client) 666 PDFiumEngine::PDFiumEngine(PDFEngine::Client* client)
667 : client_(client), 667 : client_(client),
668 current_zoom_(1.0), 668 current_zoom_(1.0),
669 current_rotation_(0), 669 current_rotation_(0),
670 doc_loader_(this), 670 doc_loader_(this),
671 password_tries_remaining_(0), 671 password_tries_remaining_(0),
672 doc_(nullptr), 672 doc_(nullptr),
673 form_(nullptr), 673 form_(nullptr),
(...skipping 3445 matching lines...) Expand 10 before | Expand all | Expand 10 after
4119 FPDF_DOCUMENT doc = 4119 FPDF_DOCUMENT doc =
4120 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); 4120 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr);
4121 if (!doc) 4121 if (!doc)
4122 return false; 4122 return false;
4123 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; 4123 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0;
4124 FPDF_CloseDocument(doc); 4124 FPDF_CloseDocument(doc);
4125 return success; 4125 return success;
4126 } 4126 }
4127 4127
4128 } // namespace chrome_pdf 4128 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/pdf_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698