| OLD | NEW |
| 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 Loading... |
| 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 3455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4129 FPDF_DOCUMENT doc = | 4129 FPDF_DOCUMENT doc = |
| 4130 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); | 4130 FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, nullptr); |
| 4131 if (!doc) | 4131 if (!doc) |
| 4132 return false; | 4132 return false; |
| 4133 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4133 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
| 4134 FPDF_CloseDocument(doc); | 4134 FPDF_CloseDocument(doc); |
| 4135 return success; | 4135 return success; |
| 4136 } | 4136 } |
| 4137 | 4137 |
| 4138 } // namespace chrome_pdf | 4138 } // namespace chrome_pdf |
| OLD | NEW |