diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-25 18:49:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-25 18:49:32 +0000 |
commit | e08d2b1fee0db40bac9538ca8b7be0a951675bd6 (patch) | |
tree | 81ded468a54adb247f46d7824632f6c4a537619c /testing/embedder_test.h | |
parent | eb3ec8f29846a5df67269a53ca94d1d740c84513 (diff) | |
download | pdfium-e08d2b1fee0db40bac9538ca8b7be0a951675bd6.tar.xz |
Introduce ScopedFPDF types in public/cpp/fpdf_scopers.h
Applies std::remove_ptr to the public API types so that we can
deduce a correct unique ptr type no matter how that API might
change away from void* usage.
Creates shorter names for std::unique_ptr<std::remove_pointer<>, ...>
Change-Id: I04a0ff43cb7d5a4d3867939a53a54c9cef00db86
Reviewed-on: https://pdfium-review.googlesource.com/31292
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/embedder_test.h')
-rw-r--r-- | testing/embedder_test.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/testing/embedder_test.h b/testing/embedder_test.h index 4923180c4a..8156dd2353 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -9,7 +9,7 @@ #include <memory> #include <string> -#include "public/cpp/fpdf_deleters.h" +#include "public/cpp/fpdf_scopers.h" #include "public/fpdf_dataavail.h" #include "public/fpdf_ext.h" #include "public/fpdf_formfill.h" @@ -126,26 +126,22 @@ class EmbedderTest : public ::testing::Test, void UnloadPage(FPDF_PAGE page); // RenderLoadedPageWithFlags() with no flags. - std::unique_ptr<void, FPDFBitmapDeleter> RenderLoadedPage(FPDF_PAGE page); + ScopedFPDFBitmap RenderLoadedPage(FPDF_PAGE page); // Convert |page| loaded via LoadPage() into a bitmap with the specified page // rendering |flags|. // // See public/fpdfview.h for a list of page rendering flags. - std::unique_ptr<void, FPDFBitmapDeleter> RenderLoadedPageWithFlags( - FPDF_PAGE page, - int flags); + ScopedFPDFBitmap RenderLoadedPageWithFlags(FPDF_PAGE page, int flags); // RenderSavedPageWithFlags() with no flags. - std::unique_ptr<void, FPDFBitmapDeleter> RenderSavedPage(FPDF_PAGE page); + ScopedFPDFBitmap RenderSavedPage(FPDF_PAGE page); // Convert |page| loaded via LoadSavedPage() into a bitmap with the specified // page rendering |flags|. // // See public/fpdfview.h for a list of page rendering flags. - std::unique_ptr<void, FPDFBitmapDeleter> RenderSavedPageWithFlags( - FPDF_PAGE page, - int flags); + ScopedFPDFBitmap RenderSavedPageWithFlags(FPDF_PAGE page, int flags); // Convert |page| into a bitmap with the specified page rendering |flags|. // The form handle associated with |page| should be passed in via |handle|. @@ -153,8 +149,9 @@ class EmbedderTest : public ::testing::Test, // // See public/fpdfview.h for a list of page rendering flags. // If none of the above Render methods are appropriate, then use this one. - static std::unique_ptr<void, FPDFBitmapDeleter> - RenderPageWithFlags(FPDF_PAGE page, FPDF_FORMHANDLE handle, int flags); + static ScopedFPDFBitmap RenderPageWithFlags(FPDF_PAGE page, + FPDF_FORMHANDLE handle, + int flags); protected: using PageNumberToHandleMap = std::map<int, FPDF_PAGE>; |