forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdfium_unsupported_features.h
36 lines (26 loc) · 1.11 KB
/
pdfium_unsupported_features.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PDF_PDFIUM_PDFIUM_UNSUPPORTED_FEATURES_H_
#define PDF_PDFIUM_PDFIUM_UNSUPPORTED_FEATURES_H_
#include "base/memory/raw_ptr.h"
namespace chrome_pdf {
class PDFiumEngine;
void InitializeUnsupportedFeaturesHandler();
// Create a local variable of this when calling PDFium functions which can call
// our global callback when an unsupported feature is reached.
class ScopedUnsupportedFeature {
public:
// For use by PDFiumEngineExports when there is no PDFiumEngine instance.
enum NoEngine { kNoEngine };
explicit ScopedUnsupportedFeature(PDFiumEngine* engine);
explicit ScopedUnsupportedFeature(NoEngine no_engine);
ScopedUnsupportedFeature(const ScopedUnsupportedFeature&) = delete;
ScopedUnsupportedFeature& operator=(const ScopedUnsupportedFeature&) = delete;
~ScopedUnsupportedFeature();
private:
const bool saved_engine_available_;
const raw_ptr<PDFiumEngine> saved_engine_;
};
} // namespace chrome_pdf
#endif // PDF_PDFIUM_PDFIUM_UNSUPPORTED_FEATURES_H_