summaryrefslogtreecommitdiff
path: root/www-client/chromium/files/chromium-123-qrgen-disablerust.patch
blob: ef5865505ecb22ab2b766872d9cfdd0198109b6a (plain) (blame)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
diff --git a/components/qr_code_generator/BUILD.gn b/components/qr_code_generator/BUILD.gn
index c45d0c4039..ba2e27878b 100644
--- a/components/qr_code_generator/BUILD.gn
+++ b/components/qr_code_generator/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 import("//build/buildflag_header.gni")
-import("//build/config/rust.gni")
+# import("//build/config/rust.gni")
 import("//testing/libfuzzer/fuzzer_test.gni")
 
 declare_args() {
@@ -40,20 +40,20 @@ source_set("qr_code_generator") {
   ]
   deps = [
     ":qr_code_generator_features",
-    ":qr_code_generator_ffi_glue",
+#    ":qr_code_generator_ffi_glue",
     "//base",
   ]
   public_deps = [ "//base" ]
 }
 
-rust_static_library("qr_code_generator_ffi_glue") {
-  allow_unsafe = true  # Needed for FFI that underpins the `cxx` crate.
-  crate_root = "qr_code_generator_ffi_glue.rs"
-  sources = [ "qr_code_generator_ffi_glue.rs" ]
-  cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ]
-  visibility = [ ":qr_code_generator" ]
-  deps = [ "//third_party/rust/qr_code/v2:lib" ]
-}
+#rust_static_library("qr_code_generator_ffi_glue") {
+#  allow_unsafe = true  # Needed for FFI that underpins the `cxx` crate.
+#  crate_root = "qr_code_generator_ffi_glue.rs"
+#  sources = [ "qr_code_generator_ffi_glue.rs" ]
+#  cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ]
+#  visibility = [ ":qr_code_generator" ]
+#  deps = [ "//third_party/rust/qr_code/v2:lib" ]
+#}
 
 source_set("unit_tests") {
   testonly = true
diff --git a/components/qr_code_generator/qr_code_generator.cc b/components/qr_code_generator/qr_code_generator.cc
index b1531f5026..da5a4c5382 100644
--- a/components/qr_code_generator/qr_code_generator.cc
+++ b/components/qr_code_generator/qr_code_generator.cc
@@ -11,12 +11,12 @@
 #include <vector>
 
 #include "base/check_op.h"
-#include "base/containers/span_rust.h"
+//#include "base/containers/span_rust.h"
 #include "base/memory/raw_ptr.h"
 #include "base/notreached.h"
 #include "base/numerics/safe_conversions.h"
 #include "components/qr_code_generator/features.h"
-#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h"
+//#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h"
 
 namespace qr_code_generator {
 
@@ -572,7 +572,7 @@ size_t SegmentSpanLength(base::span<const QRCodeGenerator::Segment> segments) {
   return sum;
 }
 
-std::optional<QRCodeGenerator::GeneratedCode> GenerateQrCodeUsingRust(
+/*std::optional<QRCodeGenerator::GeneratedCode> GenerateQrCodeUsingRust(
     base::span<const uint8_t> in,
     std::optional<int> min_version) {
   rust::Slice<const uint8_t> rs_in = base::SpanToRustSlice(in);
@@ -595,7 +595,7 @@ std::optional<QRCodeGenerator::GeneratedCode> GenerateQrCodeUsingRust(
   code.qr_size = base::checked_cast<int>(result_width);
   CHECK_EQ(code.data.size(), static_cast<size_t>(code.qr_size * code.qr_size));
   return code;
-}
+}*/
 
 }  // namespace
 
@@ -613,9 +613,9 @@ QRCodeGenerator::GeneratedCode::~GeneratedCode() = default;
 std::optional<QRCodeGenerator::GeneratedCode> QRCodeGenerator::Generate(
     base::span<const uint8_t> in,
     std::optional<int> min_version) {
-  if (IsRustyQrCodeGeneratorFeatureEnabled()) {
+  /*if (IsRustyQrCodeGeneratorFeatureEnabled()) {
     return GenerateQrCodeUsingRust(in, min_version);
-  }
+  }*/
 
   if (in.size() > kMaxInputSize) {
     return std::nullopt;