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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1554533002: Mark methods with override in pdf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Clang plugin flag correctly Created 5 years 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') | pdf/preview_mode_client.h » ('j') | 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 9bf10fb7c515dbe0390117372f5955b2f79ff83e..90c4df56f62cb167e24df8c0b2f2780acb317cf6 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -11,6 +11,7 @@
#include "base/i18n/icu_encoding_detection.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/json/json_writer.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -3777,12 +3778,11 @@ ScopedUnsupportedFeature::~ScopedUnsupportedFeature() {
g_engine_for_unsupported = old_engine_;
}
-PDFEngineExports* PDFEngineExports::Create() {
- return new PDFiumEngineExports;
-}
-
namespace {
+base::LazyInstance<PDFiumEngineExports>::Leaky g_pdf_engine_exports =
+ LAZY_INSTANCE_INITIALIZER;
+
int CalculatePosition(FPDF_PAGE page,
const PDFiumEngineExports::RenderingSettings& settings,
pp::Rect* dest) {
@@ -3848,6 +3848,10 @@ int CalculatePosition(FPDF_PAGE page,
} // namespace
+PDFEngineExports* PDFEngineExports::Get() {
+ return g_pdf_engine_exports.Pointer();
+}
+
#if defined(OS_WIN)
bool PDFiumEngineExports::RenderPDFPageToDC(const void* pdf_buffer,
int buffer_size,
@@ -3931,7 +3935,7 @@ bool PDFiumEngineExports::RenderPDFPageToDC(const void* pdf_buffer,
FPDF_CloseDocument(doc);
return true;
}
-#endif // OS_WIN
+#endif // defined(OS_WIN)
bool PDFiumEngineExports::RenderPDFPageToBitmap(
const void* pdf_buffer,
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | pdf/preview_mode_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698