Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7eca853
Use abort() for NOTREACHED()
pbos Aug 13, 2024
61e2124
Remove NOTREACHED_IN_MIGRATION()
pbos Aug 13, 2024
feb7c08
Move/remove macros in compiler_specific.h to match Chromium.
pkasting Aug 22, 2024
e04c707
Remove `WPRINTF_FORMAT`.
pkasting Aug 22, 2024
4027559
Make LOG(FATAL) [[noreturn]]
pbos Oct 3, 2024
d288241
Fix LOG(FATAL) compile errors
pbos Oct 3, 2024
c081fd0
Reimplement LAZY_STREAM with a switch
pbos Oct 3, 2024
c4bcfd0
#include <stddef.h> for size_t
markmentovai Nov 12, 2024
ec9a9b4
Add fixed_extent to base::span.
pkasting Dec 12, 2024
63057a1
Fix template param shadowing.
pkasting Dec 12, 2024
22f743d
Remove distutils dependency
speednoisemovement Dec 17, 2024
12ef786
OWN mini_chromium
markmentovai Jan 17, 2025
08d4905
Prepare mini_chromium for using clang on Windows
nico Feb 13, 2025
a7df884
Enable clang by default on Windows
nico Feb 24, 2025
cb60252
Run clang arm64 asm under env wrapper
nico Feb 25, 2025
107106f
Reformat all Python scripts according to Google style
markmentovai Feb 26, 2025
aa56c39
win_helper: invoke vswhere with -products * to work with VS Build Tools
markmentovai Feb 26, 2025
af17e4d
Fix win-arm64 MSVC builds, and maybe other builds
markmentovai Feb 27, 2025
7ce5c0a
apple: Remove unused references to SecKeychain
tamird Mar 15, 2025
9e1a214
build: Add tvOS support to C++ and GN
rakuco Mar 25, 2025
fc4d1c2
base: Remove USE_ASL and corresponding usage from base/logging.cc
rakuco Mar 25, 2025
7477036
build: Add tvOS's id to BuildInfo.plist's UIDeviceFamily array
rakuco Mar 21, 2025
55a0fe7
Add .clang-format
markmentovai Mar 25, 2025
15d1cac
Fix -Wimplicit-int-conversion error
ilovepi Mar 24, 2025
035254c
ios: Fix compile with Xcode 16.3
strangewiz Apr 4, 2025
40dabd1
[base] Fix Windows 64-bit build warnings
bhamiltoncx Apr 4, 2025
361ef33
base: remove numerics namespace from byte ops
Apr 23, 2025
4e79cec
Change mini_chromium's deployment target to macOS 12
May 28, 2025
e40cb2d
base: Switch to Fuchsia's SDK logging API
sutes-work Jul 23, 2025
eef0dc3
Convert base::StringPiece to std::string_view
Aug 15, 2025
eef885b
Remove remaining references to StringPiece
Aug 15, 2025
e5a8d55
mini_chromium: Remove Barrier_AtomicIncrement, no longer used
vsrinivas Jul 25, 2025
d5aae36
Merge branch 'main' of https://chromium.googlesource.com/chromium/min…
JoshuaMoelans Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2013 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
BasedOnStyle: Chromium,
AlignTrailingComments: false,
BinPackArguments: false,
InsertBraces: true,
InsertNewlineAtEOF: true,
Standard: Cpp11,
}
12 changes: 12 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2025 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set noparent

jperaza@chromium.org
justincohen@chromium.org
lgrey@chromium.org
mark@chromium.org
pbos@chromium.org
wfh@chromium.org
5 changes: 2 additions & 3 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static_library("base") {
"strings/strcat_internal.h",
"strings/string_number_conversions.cc",
"strings/string_number_conversions.h",
"strings/string_piece.h",
"strings/string_util.h",
"strings/stringprintf.cc",
"strings/stringprintf.h",
Expand Down Expand Up @@ -155,9 +154,9 @@ static_library("base") {
]

if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
deps = [ "//zircon/system/ulib/syslog" ]
deps = [ "//sdk/lib/syslog/cpp" ]
} else {
deps = [ "//third_party/fuchsia/sdk/$host_os-amd64/pkg/syslog" ]
deps = [ "//third_party/fuchsia/sdk/$host_os-amd64/pkg/syslog_cpp" ]
}
}

Expand Down
5 changes: 0 additions & 5 deletions base/apple/foundation_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ CF_CAST_DECL(CGColor);
CF_CAST_DECL(CTFont);
CF_CAST_DECL(CTRun);

#if !BUILDFLAG(IS_IOS)
CF_CAST_DECL(SecACL);
CF_CAST_DECL(SecTrustedApplication);
#endif

#undef CF_CAST_DECL

#if defined(__OBJC__)
Expand Down
12 changes: 0 additions & 12 deletions base/apple/foundation_util.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

#include "base/check.h"

#if !BUILDFLAG(IS_IOS)
extern "C" {
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
} // extern "C"
#endif

namespace base {
namespace apple {

Expand Down Expand Up @@ -53,11 +46,6 @@
CF_CAST_DEFN(CTFont)
CF_CAST_DEFN(CTRun)

#if !BUILDFLAG(IS_IOS)
CF_CAST_DEFN(SecACL)
CF_CAST_DEFN(SecTrustedApplication)
#endif

#undef CF_CAST_DEFN

} // namespace apple
Expand Down
21 changes: 21 additions & 0 deletions base/apple/mach_logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <iomanip>
#include <string>

#include "base/immediate_crash.h"
#include "base/strings/stringprintf.h"

#if !BUILDFLAG(IS_IOS)
Expand Down Expand Up @@ -37,10 +38,20 @@ MachLogMessage::MachLogMessage(const char* function,
: LogMessage(function, file_path, line, severity), mach_err_(mach_err) {}

MachLogMessage::~MachLogMessage() {
AppendError();
}

void MachLogMessage::AppendError() {
stream() << ": " << mach_error_string(mach_err_)
<< FormatMachErrorNumber(mach_err_);
}

MachLogMessageFatal::~MachLogMessageFatal() {
AppendError();
Flush();
base::ImmediateCrash();
}

#if !BUILDFLAG(IS_IOS)

BootstrapLogMessage::BootstrapLogMessage(const char* function,
Expand All @@ -52,6 +63,10 @@ BootstrapLogMessage::BootstrapLogMessage(const char* function,
bootstrap_err_(bootstrap_err) {}

BootstrapLogMessage::~BootstrapLogMessage() {
AppendError();
}

void BootstrapLogMessage::AppendError() {
stream() << ": " << bootstrap_strerror(bootstrap_err_);

switch (bootstrap_err_) {
Expand Down Expand Up @@ -79,6 +94,12 @@ BootstrapLogMessage::~BootstrapLogMessage() {
}
}

BootstrapLogMessageFatal::~BootstrapLogMessageFatal() {
AppendError();
Flush();
base::ImmediateCrash();
}

#endif // !BUILDFLAG(IS_IOS)

} // namespace logging
18 changes: 18 additions & 0 deletions base/apple/mach_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ class MachLogMessage : public logging::LogMessage {

~MachLogMessage();

protected:
void AppendError();

private:
mach_error_t mach_err_;
};

class MachLogMessageFatal final : public MachLogMessage {
public:
using MachLogMessage::MachLogMessage;
[[noreturn]] ~MachLogMessageFatal() override;
};

} // namespace logging

#define MACH_LOG_STREAM(severity, mach_err) \
Expand Down Expand Up @@ -108,10 +117,19 @@ class BootstrapLogMessage : public logging::LogMessage {

~BootstrapLogMessage();

protected:
void AppendError();

private:
kern_return_t bootstrap_err_;
};

class BootstrapLogMessageFatal final : public BootstrapLogMessage {
public:
using BootstrapLogMessage::BootstrapLogMessage;
[[noreturn]] ~BootstrapLogMessageFatal() override;
};

} // namespace logging

#define BOOTSTRAP_LOG_STREAM(severity, bootstrap_err) \
Expand Down
4 changes: 0 additions & 4 deletions base/atomicops.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);
// *ptr with the increment applied. This routine implies no memory barriers.
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);

Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment);

// These following lower-level operations are typically useful only to people
// implementing higher-level synchronization operations like spinlocks,
// mutexes, and condition-variables. They combine CompareAndSwap(), a load, or
Expand Down Expand Up @@ -122,7 +119,6 @@ Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 new_value);
Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value);
Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);

Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Expand Down
6 changes: 0 additions & 6 deletions base/atomicops_internals_atomicword_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr,
reinterpret_cast<volatile Atomic32*>(ptr), increment);
}

inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr,
AtomicWord increment) {
return Barrier_AtomicIncrement(
reinterpret_cast<volatile Atomic32*>(ptr), increment);
}

inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr,
AtomicWord old_value,
AtomicWord new_value) {
Expand Down
10 changes: 0 additions & 10 deletions base/atomicops_internals_portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
->fetch_add(increment, std::memory_order_relaxed);
}

inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) {
return increment + ((AtomicLocation32)ptr)->fetch_add(increment);
}

inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) {
Expand Down Expand Up @@ -161,11 +156,6 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
->fetch_add(increment, std::memory_order_relaxed);
}

inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) {
return increment + ((AtomicLocation64)ptr)->fetch_add(increment);
}

inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) {
Expand Down
69 changes: 0 additions & 69 deletions base/compiler_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@
#define NOT_TAIL_CALLED
#endif

// Specify memory alignment for structs, classes, etc.
// Use like:
// class ALIGNAS(16) MyClass { ... }
// ALIGNAS(16) int array[4];
//
// In most places you can use the C++11 keyword "alignas", which is preferred.
//
// Historically, compilers had trouble mixing __attribute__((...)) syntax with
// alignas(...) syntax. However, at least Clang is very accepting nowadays. It
// may be that this macro can be removed entirely.
#if defined(__clang__)
#define ALIGNAS(byte_alignment) alignas(byte_alignment)
#elif defined(COMPILER_MSVC)
#define ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
#elif defined(COMPILER_GCC) && HAS_ATTRIBUTE(aligned)
#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
#endif

// In case the compiler supports it NO_UNIQUE_ADDRESS evaluates to the C++20
// attribute [[no_unique_address]]. This allows annotating data members so that
// they need not have an address distinct from all other non-static data members
Expand Down Expand Up @@ -131,13 +113,6 @@
#define PRINTF_FORMAT(format_param, dots_param)
#endif

// WPRINTF_FORMAT is the same, but for wide format strings.
// This doesn't appear to yet be implemented in any compiler.
// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 .
#define WPRINTF_FORMAT(format_param, dots_param)
// If available, it would look like:
// __attribute__((format(wprintf, format_param, dots_param)))

// Sanitizers annotations.
#if HAS_ATTRIBUTE(no_sanitize)
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
Expand Down Expand Up @@ -205,32 +180,6 @@
#define DISABLE_CFI_DLSYM
#endif

// Macro useful for writing cross-platform function pointers.
#if !defined(CDECL)
#if BUILDFLAG(IS_WIN)
#define CDECL __cdecl
#else // BUILDFLAG(IS_WIN)
#define CDECL
#endif // BUILDFLAG(IS_WIN)
#endif // !defined(CDECL)

// Macro for hinting that an expression is likely to be false.
#if !defined(UNLIKELY)
#if defined(COMPILER_GCC) || defined(__clang__)
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#else
#define UNLIKELY(x) (x)
#endif // defined(COMPILER_GCC)
#endif // !defined(UNLIKELY)

#if !defined(LIKELY)
#if defined(COMPILER_GCC) || defined(__clang__)
#define LIKELY(x) __builtin_expect(!!(x), 1)
#else
#define LIKELY(x) (x)
#endif // defined(COMPILER_GCC)
#endif // !defined(LIKELY)

// Compiler feature-detection.
// clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension
#if defined(__has_feature)
Expand All @@ -248,24 +197,6 @@
#define PRETTY_FUNCTION __func__
#endif

#if !defined(CPU_ARM_NEON)
#if defined(__arm__)
#if !defined(__ARMEB__) && !defined(__ARM_EABI__) && !defined(__EABI__) && \
!defined(__VFP_FP__) && !defined(_WIN32_WCE) && !defined(ANDROID)
#error Chromium does not support middle endian architecture
#endif
#if defined(__ARM_NEON__)
#define CPU_ARM_NEON 1
#endif
#endif // defined(__arm__)
#endif // !defined(CPU_ARM_NEON)

#if !defined(HAVE_MIPS_MSA_INTRINSICS)
#if defined(__mips_msa) && defined(__mips_isa_rev) && (__mips_isa_rev >= 5)
#define HAVE_MIPS_MSA_INTRINSICS 1
#endif
#endif

#if defined(__clang__) && HAS_ATTRIBUTE(uninitialized)
// Attribute "uninitialized" disables -ftrivial-auto-var-init=pattern for
// the specified variable.
Expand Down
12 changes: 12 additions & 0 deletions base/fuchsia/fuchsia_logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <iomanip>

#include "base/immediate_crash.h"

namespace logging {

ZxLogMessage::ZxLogMessage(const char* function,
Expand All @@ -18,10 +20,20 @@ ZxLogMessage::ZxLogMessage(const char* function,
: LogMessage(function, file_path, line, severity), zx_err_(zx_err) {}

ZxLogMessage::~ZxLogMessage() {
AppendError();
}

void ZxLogMessage::AppendError() {
// zx_status_t error values are negative, so log the numeric version as
// decimal rather than hex. This is also useful to match zircon/errors.h for
// grepping.
stream() << ": " << zx_status_get_string(zx_err_) << " (" << zx_err_ << ")";
}

ZxLogMessageFatal::~ZxLogMessageFatal() {
AppendError();
Flush();
base::ImmediateCrash();
}

} // namespace logging
9 changes: 9 additions & 0 deletions base/fuchsia/fuchsia_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ class ZxLogMessage : public logging::LogMessage {

~ZxLogMessage();

protected:
void AppendError();

private:
zx_status_t zx_err_;
};

class ZxLogMessageFatal final : public ZxLogMessage {
public:
using ZxLogMessage::ZxLogMessage;
[[noreturn]] ~ZxLogMessageFatal() override;
};

} // namespace logging

#define ZX_LOG_STREAM(severity, zx_err) \
Expand Down
Loading