summaryrefslogtreecommitdiff
path: root/public/cpp
diff options
context:
space:
mode:
authorAndrew Weintraub <asweintraub@google.com>2018-07-17 21:42:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-17 21:42:17 +0000
commit8e0c0dbc4876e661de6c344c759ffe22d3f13bce (patch)
tree87f431ab072f8040868b7fd8a10f6035a8c143d1 /public/cpp
parent3d7b555aa843b026c9dcb6b0f855af1d358ef2ba (diff)
downloadpdfium-8e0c0dbc4876e661de6c344c759ffe22d3f13bce.tar.xz
Add Deleter and Scoper for FPDF_PAGELINK.chromium/3495
Change-Id: Ie997bfa5437d4222a381be3fc2b4334d6c8e2d5b Reviewed-on: https://pdfium-review.googlesource.com/38190 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'public/cpp')
-rw-r--r--public/cpp/fpdf_deleters.h6
-rw-r--r--public/cpp/fpdf_scopers.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/public/cpp/fpdf_deleters.h b/public/cpp/fpdf_deleters.h
index 51e7cba7f8..d9d95cda3b 100644
--- a/public/cpp/fpdf_deleters.h
+++ b/public/cpp/fpdf_deleters.h
@@ -45,6 +45,12 @@ struct FPDFPageDeleter {
inline void operator()(FPDF_PAGE page) { FPDF_ClosePage(page); }
};
+struct FPDFPageLinkDeleter {
+ inline void operator()(FPDF_PAGELINK pagelink) {
+ FPDFLink_CloseWebLinks(pagelink);
+ }
+};
+
struct FPDFStructTreeDeleter {
inline void operator()(FPDF_STRUCTTREE tree) { FPDF_StructTree_Close(tree); }
};
diff --git a/public/cpp/fpdf_scopers.h b/public/cpp/fpdf_scopers.h
index 1898ac887d..3601f47344 100644
--- a/public/cpp/fpdf_scopers.h
+++ b/public/cpp/fpdf_scopers.h
@@ -44,6 +44,10 @@ using ScopedFPDFTextPage =
using ScopedFPDFPage =
std::unique_ptr<std::remove_pointer<FPDF_PAGE>::type, FPDFPageDeleter>;
+using ScopedFPDFPageLink =
+ std::unique_ptr<std::remove_pointer<FPDF_PAGELINK>::type,
+ FPDFPageLinkDeleter>;
+
using ScopedFPDFStructTree =
std::unique_ptr<std::remove_pointer<FPDF_STRUCTTREE>::type,
FPDFStructTreeDeleter>;