mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2025-02-24 10:53:19 +03:00
base: Remove Rust
This commit is contained in:
parent
5b2a6a96d4
commit
e8f0aafd30
@ -1028,12 +1028,6 @@ component("base") {
|
|||||||
if (!is_nacl) {
|
if (!is_nacl) {
|
||||||
# Used by metrics/crc32, except on NaCl builds.
|
# Used by metrics/crc32, except on NaCl builds.
|
||||||
deps += [ "//third_party/zlib" ]
|
deps += [ "//third_party/zlib" ]
|
||||||
|
|
||||||
# NaCl does not support Rust.
|
|
||||||
deps += [
|
|
||||||
":rust_logger",
|
|
||||||
"//third_party/rust/serde_json_lenient/v0_2/wrapper",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# `raw_ptr` cannot be made a component due to CRT symbol issues.
|
# `raw_ptr` cannot be made a component due to CRT symbol issues.
|
||||||
@ -1070,17 +1064,6 @@ component("base") {
|
|||||||
"//third_party/abseil-cpp:absl",
|
"//third_party/abseil-cpp:absl",
|
||||||
]
|
]
|
||||||
|
|
||||||
if (!is_nacl) {
|
|
||||||
sources += [
|
|
||||||
"containers/span_rust.h",
|
|
||||||
"strings/string_view_rust.h",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Base provides conversions between CXX types and base types (e.g.
|
|
||||||
# std::string_view).
|
|
||||||
public_deps += [ "//build/rust:cxx_cppdeps" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Needed for <atomic> if using newer C++ library than sysroot, except if
|
# Needed for <atomic> if using newer C++ library than sysroot, except if
|
||||||
# building inside the cros_sdk environment - use host_toolchain as a
|
# building inside the cros_sdk environment - use host_toolchain as a
|
||||||
# more robust check for this.
|
# more robust check for this.
|
||||||
@ -2452,41 +2435,6 @@ component("base") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_bindgen("logging_log_severity_bindgen") {
|
|
||||||
# TODO(danakj): Maybe combine all base bindgen targets, or all base/logging
|
|
||||||
# ones even) into a single GN target? But the GN rule needs to handle multiple
|
|
||||||
# headers then.
|
|
||||||
header = "logging/log_severity.h"
|
|
||||||
cpp = true
|
|
||||||
visibility = [ ":*" ]
|
|
||||||
|
|
||||||
# Transitive generated header dependency.
|
|
||||||
deps = [ ":debugging_buildflags" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
rust_bindgen("logging_rust_log_integration_bindgen") {
|
|
||||||
header = "logging/rust_log_integration.h"
|
|
||||||
cpp = true
|
|
||||||
visibility = [ ":*" ]
|
|
||||||
|
|
||||||
# Transitive generated header dependency.
|
|
||||||
deps = [ ":debugging_buildflags" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
rust_static_library("rust_logger") {
|
|
||||||
allow_unsafe = true # Unsafe needed for FFI.
|
|
||||||
deps = [
|
|
||||||
":logging_log_severity_bindgen",
|
|
||||||
":logging_rust_log_integration_bindgen",
|
|
||||||
"//third_party/rust/log/v0_4:lib",
|
|
||||||
]
|
|
||||||
visibility = [ ":base" ]
|
|
||||||
sources = [ "logging/rust_logger.rs" ]
|
|
||||||
crate_root = "logging/rust_logger.rs"
|
|
||||||
|
|
||||||
cxx_bindings = [ "logging/rust_logger.rs" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_linux || is_chromeos) {
|
if (is_linux || is_chromeos) {
|
||||||
# Split out as a separate target for two reasons:
|
# Split out as a separate target for two reasons:
|
||||||
# - the line number reader is 2x slower in debug builds if not optimized,
|
# - the line number reader is 2x slower in debug builds if not optimized,
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "base/metrics/histogram_macros.h"
|
#include "base/metrics/histogram_macros.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_NACL)
|
#if 0 // Disables Rust
|
||||||
#include "base/strings/string_view_rust.h"
|
#include "base/strings/string_view_rust.h"
|
||||||
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h"
|
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/functions.h"
|
||||||
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h"
|
#include "third_party/rust/serde_json_lenient/v0_2/wrapper/lib.rs.h"
|
||||||
@ -23,7 +23,7 @@ namespace base {
|
|||||||
|
|
||||||
// TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just
|
// TODO(crbug.com/40811643): Move the C++ parser into components/nacl to just
|
||||||
// run in-process there. Don't compile base::JSONReader on NaCL at all.
|
// run in-process there. Don't compile base::JSONReader on NaCL at all.
|
||||||
#if !BUILDFLAG(IS_NACL)
|
#if 0 // Disables Rust
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using serde_json_lenient::ContextPointer;
|
using serde_json_lenient::ContextPointer;
|
||||||
@ -135,7 +135,7 @@ JSONReader::Result DecodeJSONInRust(std::string_view json,
|
|||||||
std::optional<Value> JSONReader::Read(std::string_view json,
|
std::optional<Value> JSONReader::Read(std::string_view json,
|
||||||
int options,
|
int options,
|
||||||
size_t max_depth) {
|
size_t max_depth) {
|
||||||
#if BUILDFLAG(IS_NACL)
|
#if 1 // Disables Rust
|
||||||
internal::JSONParser parser(options, max_depth);
|
internal::JSONParser parser(options, max_depth);
|
||||||
return parser.Parse(json);
|
return parser.Parse(json);
|
||||||
#else // BUILDFLAG(IS_NACL)
|
#else // BUILDFLAG(IS_NACL)
|
||||||
@ -168,7 +168,7 @@ std::optional<Value::Dict> JSONReader::ReadDict(std::string_view json,
|
|||||||
JSONReader::Result JSONReader::ReadAndReturnValueWithError(
|
JSONReader::Result JSONReader::ReadAndReturnValueWithError(
|
||||||
std::string_view json,
|
std::string_view json,
|
||||||
int options) {
|
int options) {
|
||||||
#if BUILDFLAG(IS_NACL)
|
#if 1 // Disables Rust
|
||||||
internal::JSONParser parser(options);
|
internal::JSONParser parser(options);
|
||||||
auto value = parser.Parse(json);
|
auto value = parser.Parse(json);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@ -208,7 +208,7 @@ bool JSONReader::UsingRust() {
|
|||||||
if (!base::FeatureList::GetInstance()) {
|
if (!base::FeatureList::GetInstance()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if BUILDFLAG(IS_NACL)
|
#if 1 // Disables Rust
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser);
|
return base::FeatureList::IsEnabled(base::features::kUseRustJsonParser);
|
||||||
|
@ -127,7 +127,7 @@ typedef FILE* FileHandle;
|
|||||||
#include "base/fuchsia/scoped_fx_logger.h"
|
#include "base/fuchsia/scoped_fx_logger.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_NACL)
|
#if 0 // Disables Rust
|
||||||
#include "base/logging/rust_logger.rs.h"
|
#include "base/logging/rust_logger.rs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ bool BaseInitLoggingImpl(const LoggingSettings& settings) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !BUILDFLAG(IS_NACL)
|
#if 0 // Disables Rust
|
||||||
// Connects Rust logging with the //base logging functionality.
|
// Connects Rust logging with the //base logging functionality.
|
||||||
internal::init_rust_log_crate();
|
internal::init_rust_log_crate();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user