aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicture.cpp
diff options
context:
space:
mode:
authorGravatar hendrikw <hendrikw@chromium.org>2015-06-16 09:28:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-16 09:28:37 -0700
commit446ee67fda73b11281b8e28a68edec811347c0c5 (patch)
treeba5be6dc7c9acb93e7d6bde7d2ac292a73712ca7 /src/core/SkPicture.cpp
parent0fce1fb02d93e66d42528f322f8aa4ca64ff0fb2 (diff)
skia: Add runtime option to disable picture IO security precautions
Replaced the compile time file IO security setting with a runtime setting. Unfortunately the setting is global. Review URL: https://codereview.chromium.org/1183853003
Diffstat (limited to 'src/core/SkPicture.cpp')
-rw-r--r--src/core/SkPicture.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 6c1f6cb759..1a8de22907 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -13,6 +13,13 @@
#include "SkPictureRecord.h"
#include "SkPictureRecorder.h"
+#if defined(SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS) || \
+ defined(SK_ENABLE_PICTURE_IO_SECURITY_PRECAUTIONS)
+static bool g_AllPictureIOSecurityPrecautionsEnabled = true;
+#else
+static bool g_AllPictureIOSecurityPrecautionsEnabled = false;
+#endif
+
DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage);
/* SkPicture impl. This handles generic responsibilities like unique IDs and serialization. */
@@ -196,3 +203,12 @@ bool SkPicture::suitableForGpuRasterization(GrContext*, const char** whyNot) con
}
return true;
}
+
+// Global setting to disable security precautions for serialization.
+void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
+ g_AllPictureIOSecurityPrecautionsEnabled = set;
+}
+
+bool SkPicture::PictureIOSecurityPrecautionsEnabled() {
+ return g_AllPictureIOSecurityPrecautionsEnabled;
+}