Key Facts
- ✓ The Chromium project has officially banned specific C++ features to maintain codebase stability and security across its massive browser ecosystem.
- ✓ These restrictions are detailed in the project's official style guide, which serves as the definitive reference for all contributors.
- ✓ Among the banned features are std::make_unique, std::make_shared, and std::regex due to compatibility and performance concerns.
- ✓ The project provides Chromium-specific alternatives like base::MakeUnique to ensure consistent behavior across all supported platforms.
- ✓ Code review processes now include automated checks that flag prohibited features before code is merged into the main branch.
- ✓ The style guide is a living document that receives regular updates as C++ standards evolve and compiler support improves.
Codebase Evolution
The Chromium project has established comprehensive guidelines banning specific C++ features to maintain stability across its massive codebase. These restrictions reflect the project's commitment to long-term maintainability and security.
As one of the largest open-source software projects in the world, Chromium's decisions impact millions of developers and users globally. The project's style guide now explicitly prohibits certain modern C++ additions that could introduce instability or security vulnerabilities.
The banned features include several modern C++ additions that could compromise the project's stability and security standards. This decision underscores the project's focus on code quality and cross-platform compatibility.
Banned Features List
The Chromium project has identified several C++ features that are now prohibited within the codebase. These restrictions are detailed in the project's official style guide, which serves as the definitive reference for contributors.
Among the banned features are:
- std::make_unique - Prohibited due to compatibility concerns
- std::make_shared - Restricted for similar compatibility reasons
- std::shared_ptr with arrays - Not allowed due to implementation inconsistencies
- std::atomic with certain types - Limited to prevent undefined behavior
- std::regex - Banned due to performance and compatibility issues
The project also restricts the use of std::filesystem and std::optional in certain contexts. These features, while part of modern C++ standards, are deemed unsuitable for Chromium's specific requirements.
The style guide emphasizes that these restrictions apply to the entire codebase, including all subprojects and dependencies. Contributors must adhere to these guidelines when submitting code for review.
Rationale Behind Restrictions
The decision to ban these features stems from Chromium's unique position as a cross-platform project supporting multiple operating systems and architectures. The project must maintain compatibility with older compilers and libraries while ensuring consistent behavior across platforms.
Security considerations also play a crucial role in these restrictions. Some modern C++ features can introduce subtle bugs or undefined behavior that could be exploited. The project's maintainers prioritize security and reliability over convenience.
Performance is another critical factor. While some modern C++ features offer convenience, they may not meet Chromium's performance requirements. The project's massive scale means even minor performance regressions can have significant impact.
The Chromium team has found that certain features, despite being part of the C++ standard, have inconsistent implementations across different platforms. This inconsistency can lead to unexpected behavior and make debugging more difficult.
Impact on Development
These restrictions significantly influence how developers write code for Chromium. Contributors must use alternative approaches that align with the project's guidelines while achieving the same functionality.
For example, instead of using std::make_unique, developers must use base::MakeUnique or similar Chromium-specific alternatives. These alternatives are carefully designed to work consistently across all supported platforms.
The project provides detailed documentation and examples for each restricted feature, helping developers understand the approved alternatives. This documentation is regularly updated as the project evolves.
Code review processes have been enhanced to catch violations of these restrictions automatically. The Chromium build system includes checks that flag prohibited features before code is merged into the main branch.
Future Considerations
The Chromium project continuously evaluates its coding standards as C++ evolves. While certain features are currently banned, the project remains open to reconsidering these decisions as compiler support improves and standards mature.
The style guide is a living document that receives regular updates. Contributors are encouraged to provide feedback and suggest modifications based on real-world experience and changing requirements.
As the project grows and new C++ standards emerge, additional features may be added to the banned list, while others might become permissible under specific conditions. This dynamic approach ensures Chromium remains at the forefront of software engineering best practices.
The project's commitment to these standards demonstrates its dedication to producing high-quality, secure, and maintainable software that serves millions of users worldwide.
Key Takeaways
The Chromium project's decision to ban specific C++ features represents a thoughtful approach to managing a massive, complex codebase. These restrictions prioritize stability, security, and maintainability over convenience.
Developers working with Chromium must adapt to these guidelines, using approved alternatives that ensure consistent behavior across platforms. While this may require additional effort, the benefits in code quality and reliability are substantial.
The project's evolving standards reflect the dynamic nature of software development, where best practices continuously improve to meet new challenges and opportunities.










