spanification: Add `#pragma allow_unsafe_buffers` to dbus/*
This is a preparation to fix each files.
This CL has no behavior changes.
This patch was fully automated using script:
https://paste.googleplex.com/5614491201175552
Note that in patchset2, change to:
/build/config/unsafe_buffers_paths.txt
was reverted. Indeed, running too many (~3) CQ run touching this file is
making the builder cache much slower. I will bundle every change to this
file in a subsequent CL. I will limit myself to 1-2 CQ run per day.
See internal doc about it:
https://docs.google.com/document/d/1erdcokeh6rfBqs_h0drHqSLtbDbB61j7j3O2Pz8NH78/edit?resourcekey=0-hNe6w1hYAYyVXGEpWI7HVA&tab=t.0
Bug: 351564777
Change-Id: I3cbfdcb56f5d0829ecf3fadd7b2118f56aec40c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5718668
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1330034}
NOKEYCHECK=True
GitOrigin-RevId: fe8f2a5f4979fba9aece40d675bcf91a08660e1e
diff --git a/end_to_end_async_unittest.cc b/end_to_end_async_unittest.cc
index bcca3d2..923c39c 100644
--- a/end_to_end_async_unittest.cc
+++ b/end_to_end_async_unittest.cc
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
#include <stddef.h>
#include <algorithm>
diff --git a/message_unittest.cc b/message_unittest.cc
index 2a77050..5f539f4 100644
--- a/message_unittest.cc
+++ b/message_unittest.cc
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
#include "dbus/message.h"
#include <stddef.h>
diff --git a/property.cc b/property.cc
index c58bed5..baab620 100644
--- a/property.cc
+++ b/property.cc
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
#include "dbus/property.h"
#include <stddef.h>
diff --git a/property_unittest.cc b/property_unittest.cc
index 164b155..d6f86b8 100644
--- a/property_unittest.cc
+++ b/property_unittest.cc
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
#include "dbus/property.h"
#include <stddef.h>
diff --git a/values_util_unittest.cc b/values_util_unittest.cc
index a94b7d2..724558b 100644
--- a/values_util_unittest.cc
+++ b/values_util_unittest.cc
@@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifdef UNSAFE_BUFFERS_BUILD
+// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
+#pragma allow_unsafe_buffers
+#endif
+
#include "dbus/values_util.h"
#include <stddef.h>