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

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 1124423006: Better error from pdfium_test when page too big to render. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Tabify Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | samples/pdfium_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 3207ebe336000ca0afd373fb31af1e5b83e0c872..606bb291d680c6ba8d374bd1935935ec429a2bfb 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -12,6 +12,7 @@
#include "../include/fpdf_ext.h"
#include "../../../core/src/fxcrt/fx_safe_types.h"
#include "../../third_party/base/numerics/safe_conversions_impl.h"
+#include "../../third_party/base/nonstd_unique_ptr.h"
Lei Zhang 2015/05/08 18:05:15 nit: alphabetical order.
Tom Sepez 2015/05/08 18:13:01 Done.
CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
{
@@ -597,9 +598,11 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha)
{
- CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
- pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32);
- return pBitmap;
+ nonstd::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
Lei Zhang 2015/05/08 18:05:15 nit: Can we get rid of tabs in this entire functio
Tom Sepez 2015/05/08 18:13:01 Yes. The only thing worse than tabs in files are
+ if (!pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32)) {
+ return NULL;
+ }
+ return pBitmap.release();
}
DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride)
« no previous file with comments | « no previous file | samples/pdfium_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698