Allow C++17's nested namespaces
This updates the style guide, adds a clang-tidy rule to help, and applies the clang-tidy rule to the base/mac files. Bug: none Change-Id: Ie0cdf3e08adc6204e6c225d3843d69b1a081cbe9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3359337 Reviewed-by: danakj chromium <danakj@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#955950}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
818ff9d951
commit
efca412acc
.clang-tidy
base
mac
authorization_util.hauthorization_util.mmbackup_util.hbackup_util.mmbackup_util_unittest.mmbundle_locations.hbundle_locations.mmcall_with_eh_frame.cccall_with_eh_frame.hcall_with_eh_frame_unittest.mmfoundation_util.hfoundation_util.mmfoundation_util_unittest.mmlaunch_services_util.hlaunch_services_util.mmlaunchd.cclaunchd.hmac_util.hmac_util.mmmac_util_unittest.mmobjc_release_properties.hobjc_release_properties.mmos_crash_dumps.ccos_crash_dumps.hscoped_aedesc.hscoped_authorizationref.hscoped_authorizationref.mmscoped_block.hscoped_cffiledescriptorref.hscoped_ionotificationportref.hscoped_ioobject.hscoped_ioplugininterface.hscoped_launch_data.hscoped_mach_port.ccscoped_mach_port.hscoped_mach_vm.ccscoped_mach_vm.hscoped_mach_vm_unittest.ccscoped_nsautorelease_pool.hscoped_nsautorelease_pool.mmscoped_objc_class_swizzler.hscoped_objc_class_swizzler.mmscoped_objc_class_swizzler_unittest.mmscoped_sending_event.hscoped_sending_event.mm
win
styleguide/c++
ui/views
@ -11,6 +11,7 @@
|
||||
google-explicit-constructor,
|
||||
google-readability-casting,
|
||||
modernize-avoid-bind,
|
||||
modernize-concat-nested-namespaces,
|
||||
modernize-loop-convert,
|
||||
modernize-make-shared,
|
||||
modernize-make-unique,
|
||||
|
@ -30,8 +30,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Obtains an AuthorizationRef for the rights indicated by |rights|. If
|
||||
// necessary, prompts the user for authentication. If the user is prompted,
|
||||
@ -76,7 +75,6 @@ OSStatus ExecuteWithPrivilegesAndWait(AuthorizationRef authorization,
|
||||
FILE** pipe,
|
||||
int* exit_status);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_AUTHORIZATION_UTIL_H_
|
||||
|
@ -21,8 +21,7 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/threading/hang_watcher.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
AuthorizationRef GetAuthorizationRightsWithPrompt(
|
||||
AuthorizationRights* rights,
|
||||
@ -206,5 +205,4 @@ OSStatus ExecuteWithPrivilegesAndWait(AuthorizationRef authorization,
|
||||
return status;
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Returns true if the file or directory at `file_path` is excluded from
|
||||
// OS-managed backups.
|
||||
@ -20,7 +20,6 @@ BASE_EXPORT bool GetBackupExclusion(const FilePath& file_path);
|
||||
// Excludes the file or directory given by `file_path` from OS-managed backups.
|
||||
BASE_EXPORT bool SetBackupExclusion(const FilePath& file_path);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_BACKUP_UTIL_H_
|
||||
|
@ -15,8 +15,7 @@
|
||||
#include "base/threading/scoped_blocking_call.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
bool GetBackupExclusion(const FilePath& file_path) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
@ -73,5 +72,4 @@ bool SetBackupExclusion(const FilePath& file_path) {
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -17,8 +17,7 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "testing/platform_test.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -68,5 +67,4 @@ TEST_F(BackupUtilTest, TestExcludeFileFromBackups_NotByPath) {
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -15,10 +15,10 @@ class NSBundle;
|
||||
#endif // __OBJC__
|
||||
|
||||
namespace base {
|
||||
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// This file provides several functions to explicitly request the various
|
||||
// component bundles of Chrome. Please use these methods rather than calling
|
||||
@ -60,7 +60,6 @@ BASE_EXPORT void SetOverrideFrameworkBundle(NSBundle* bundle);
|
||||
BASE_EXPORT void SetOverrideOuterBundlePath(const FilePath& file_path);
|
||||
BASE_EXPORT void SetOverrideFrameworkBundlePath(const FilePath& file_path);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_BUNDLE_LOCATIONS_H_
|
||||
|
@ -8,8 +8,7 @@
|
||||
#include "base/mac/foundation_util.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// NSBundle isn't threadsafe, all functions in this file must be called on the
|
||||
// main thread.
|
||||
@ -79,5 +78,4 @@ void SetOverrideFrameworkBundlePath(const FilePath& file_path) {
|
||||
AssignOverridePath(file_path, &g_override_framework_bundle);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
#if defined(__x86_64__) || defined(__aarch64__)
|
||||
extern "C" _Unwind_Reason_Code __gxx_personality_v0(int,
|
||||
@ -49,5 +48,4 @@ void CallWithEHFrame(void (^block)(void)) {
|
||||
block();
|
||||
}
|
||||
#endif // defined(__x86_64__) || defined(__aarch64__)
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -7,8 +7,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Invokes the specified block in a stack frame with a special exception
|
||||
// handler. This function creates an exception handling stack frame that
|
||||
@ -20,7 +19,6 @@ namespace mac {
|
||||
// in such a way that disrupts the generation of useful stack traces.
|
||||
void BASE_EXPORT CallWithEHFrame(void (^block)(void));
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_CALL_WITH_EH_FRAME_H_
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
namespace {
|
||||
|
||||
class CallWithEHFrameTest : public testing::Test {
|
||||
@ -51,5 +50,4 @@ TEST_F(CallWithEHFrameTest, CatchExceptionLower) {
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -47,10 +47,10 @@ typedef struct CF_BRIDGED_TYPE(id) __SecKey* SecKeyRef;
|
||||
typedef struct CF_BRIDGED_TYPE(id) __SecPolicy* SecPolicyRef;
|
||||
|
||||
namespace base {
|
||||
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Returns true if the application is running from a bundle
|
||||
BASE_EXPORT bool AmIBundled();
|
||||
@ -151,8 +151,7 @@ BASE_EXPORT const char* BaseBundleID();
|
||||
// make its own copy of new_base_bundle_id.
|
||||
BASE_EXPORT void SetBaseBundleID(const char* new_base_bundle_id);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#if !defined(__OBJC__)
|
||||
#define OBJC_CPP_CLASS_DECL(x) class x;
|
||||
@ -225,8 +224,7 @@ CF_TO_NS_CAST_DECL(CTFont, NSFont)
|
||||
#undef CF_TO_NS_MUTABLE_CAST_DECL
|
||||
#undef OBJC_CPP_CLASS_DECL
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// CFCast<>() and CFCastStrict<>() cast a basic CFTypeRef to a more
|
||||
// specific CoreFoundation type. The compatibility of the passed
|
||||
@ -373,8 +371,7 @@ BASE_EXPORT bool CFRangeToNSRange(CFRange range,
|
||||
NSRange* range_out) WARN_UNUSED_RESULT;
|
||||
#endif // defined(__OBJC__)
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
// Stream operations for CFTypes. They can be used with NSTypes as well
|
||||
// by using the NSToCFCast methods above.
|
||||
|
@ -40,8 +40,7 @@ Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
|
||||
#endif
|
||||
} // extern "C"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -499,8 +498,7 @@ bool CFRangeToNSRange(CFRange range, NSRange* range_out) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const CFStringRef string) {
|
||||
return o << base::SysCFStringRefToUTF8(string);
|
||||
|
@ -17,8 +17,7 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#import "testing/gtest_mac.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
TEST(FoundationUtilTest, CFCast) {
|
||||
// Build out the CF types to be tested as empty containers.
|
||||
@ -422,5 +421,4 @@ TEST(FoundationLoggingTest, NSRange) {
|
||||
EXPECT_LOG_EQ("{0, 100}", NSMakeRange(0, 100));
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -11,8 +11,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Launches the application bundle at |bundle_path|, passing argv[1..] from
|
||||
// |command_line| as command line arguments if the app isn't already running.
|
||||
@ -24,7 +23,6 @@ BASE_EXPORT NSRunningApplication* OpenApplicationWithPath(
|
||||
const CommandLine& command_line,
|
||||
NSWorkspaceLaunchOptions launch_options);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_LAUNCH_SERVICES_UTIL_H_
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
NSRunningApplication* OpenApplicationWithPath(
|
||||
const base::FilePath& bundle_path,
|
||||
@ -49,5 +48,4 @@ NSRunningApplication* OpenApplicationWithPath(
|
||||
return app;
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -12,8 +12,7 @@
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// MessageForJob sends a single message to launchd with a simple dictionary
|
||||
// mapping |operation| to |job_label|, and returns the result of calling
|
||||
@ -76,7 +75,6 @@ pid_t PIDForJob(const std::string& job_label) {
|
||||
return launch_data_get_integer(pid_data);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
@ -12,8 +12,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// MessageForJob sends a single message to launchd with a simple dictionary
|
||||
// mapping |operation| to |job_label|, and returns the result of calling
|
||||
@ -28,7 +27,6 @@ launch_data_t MessageForJob(const std::string& job_label,
|
||||
BASE_EXPORT
|
||||
pid_t PIDForJob(const std::string& job_label);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_LAUNCHD_H_
|
||||
|
@ -14,10 +14,10 @@
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Returns an sRGB color space. The return value is a static value; do not
|
||||
// release it!
|
||||
@ -214,7 +214,6 @@ BASE_EXPORT std::string GetOSDisplayName();
|
||||
// Returns the serial number of the macOS device.
|
||||
BASE_EXPORT std::string GetPlatformSerialNumber();
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_MAC_UTIL_H_
|
||||
|
@ -30,8 +30,7 @@
|
||||
#include "base/threading/scoped_blocking_call.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -487,5 +486,4 @@ std::string GetPlatformSerialNumber() {
|
||||
return base::SysCFStringRefToUTF8(serial_number_cfstring);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -21,8 +21,7 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "testing/platform_test.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -313,5 +312,4 @@ TEST_F(MacUtilTest, TestRemoveQuarantineAttributeNonExistentPath) {
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -45,8 +45,7 @@
|
||||
// properties. Distant subclasses might not expect it and over-release their
|
||||
// properties, so don't do that.
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace details {
|
||||
|
||||
@ -59,7 +58,6 @@ void ReleaseProperties(Self* self) {
|
||||
details::ReleaseProperties(self, [Self class]);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_OBJC_RELEASE_PROPERTIES_H_
|
||||
|
@ -45,9 +45,7 @@ id ValueOf(id obj, objc_property_t property) {
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace details {
|
||||
namespace base::mac::details {
|
||||
|
||||
void ReleaseProperties(id self, Class cls) {
|
||||
unsigned int property_count;
|
||||
@ -61,6 +59,4 @@ void ReleaseProperties(id self, Class cls) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace details
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac::details
|
||||
|
@ -11,8 +11,7 @@
|
||||
#include "base/cxx17_backports.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace {
|
||||
|
||||
@ -57,5 +56,4 @@ void DisableOSCrashDumps() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -7,8 +7,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// On Mac OS X, it can take a really long time for the OS crash handler to
|
||||
// process a Chrome crash when debugging symbols are available. This
|
||||
@ -16,7 +15,6 @@ namespace mac {
|
||||
// disables Apple Crash Reporter entirely.
|
||||
BASE_EXPORT void DisableOSCrashDumps();
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_OS_CRASH_DUMPS_H_
|
||||
|
@ -7,8 +7,7 @@
|
||||
|
||||
#import <CoreServices/CoreServices.h>
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// The ScopedAEDesc is used to scope AppleEvent descriptors. On creation,
|
||||
// it will store a NULL descriptor. On destruction, it will dispose of the
|
||||
@ -45,7 +44,6 @@ class ScopedAEDesc {
|
||||
AEDescType desc_;
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_AEDESC_H_
|
||||
|
@ -13,8 +13,7 @@
|
||||
// ScopedAuthorizationRef maintains ownership of an AuthorizationRef. It is
|
||||
// patterned after the unique_ptr interface.
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
class BASE_EXPORT ScopedAuthorizationRef {
|
||||
public:
|
||||
@ -84,7 +83,6 @@ class BASE_EXPORT ScopedAuthorizationRef {
|
||||
AuthorizationRef authorization_;
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_AUTHORIZATIONREF_H_
|
||||
|
@ -4,12 +4,10 @@
|
||||
|
||||
#include "base/mac/scoped_authorizationref.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
void ScopedAuthorizationRef::FreeInternal() {
|
||||
AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -13,8 +13,7 @@
|
||||
#error "Cannot include base/mac/scoped_block.h in file built with ARC."
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -32,7 +31,6 @@ struct ScopedBlockTraits {
|
||||
template <typename B>
|
||||
using ScopedBlock = ScopedTypeRef<B, internal::ScopedBlockTraits<B>>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_BLOCK_H_
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "base/scoped_generic.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -33,7 +32,6 @@ using ScopedCFFileDescriptorRef =
|
||||
ScopedGeneric<CFFileDescriptorRef,
|
||||
internal::ScopedCFFileDescriptorRefTraits>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_CFFILEDESCRIPTORREF_H_
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "base/scoped_generic.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -27,7 +26,6 @@ using ScopedIONotificationPortRef =
|
||||
ScopedGeneric<IONotificationPortRef,
|
||||
internal::ScopedIONotificationPortRefTraits>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_IONOTIFICATIONPORTREF_H_
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "base/mac/scoped_typeref.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -30,7 +29,6 @@ struct ScopedIOObjectTraits {
|
||||
template <typename IOT>
|
||||
using ScopedIOObject = ScopedTypeRef<IOT, internal::ScopedIOObjectTraits<IOT>>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_IOOBJECT_H_
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "base/mac/scoped_typeref.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -32,7 +31,6 @@ template <typename T>
|
||||
using ScopedIOPluginInterface =
|
||||
ScopedTypeRef<T**, internal::ScopedIOPluginInterfaceTraits<T**>>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_IOPLUGININTERFACE_H_
|
||||
|
@ -14,8 +14,7 @@
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -30,8 +29,7 @@ struct ScopedLaunchDataTraits {
|
||||
using ScopedLaunchData =
|
||||
ScopedGeneric<launch_data_t, internal::ScopedLaunchDataTraits>;
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#pragma clang diagnostic pop // -Wdeprecated-declarations
|
||||
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
#include "base/mac/mach_logging.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
namespace internal {
|
||||
|
||||
// static
|
||||
@ -72,5 +71,4 @@ ScopedMachSendRight RetainMachSendRight(mach_port_t port) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -11,8 +11,7 @@
|
||||
#include "base/scoped_generic.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -75,7 +74,6 @@ BASE_EXPORT bool CreateMachPort(
|
||||
// a new scoper to manage the additional right.
|
||||
BASE_EXPORT ScopedMachSendRight RetainMachSendRight(mach_port_t port);
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_MACH_PORT_H_
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
#include "base/mac/mach_logging.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
void ScopedMachVM::reset(vm_address_t address, vm_size_t size) {
|
||||
DCHECK_EQ(address % PAGE_SIZE, 0u);
|
||||
@ -34,5 +33,4 @@ void ScopedMachVM::reset_unaligned(vm_address_t address, vm_size_t size) {
|
||||
size_ = size;
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -43,8 +43,7 @@
|
||||
// }
|
||||
// ScopedMachVM vm_owner(address, mach_vm_round_page(size));
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
class BASE_EXPORT ScopedMachVM {
|
||||
public:
|
||||
@ -96,7 +95,6 @@ class BASE_EXPORT ScopedMachVM {
|
||||
vm_size_t size_;
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_MACH_VM_H_
|
||||
|
@ -17,8 +17,7 @@
|
||||
// allocation will report being part of the previously-deallocated large region.
|
||||
// That will cause the GetRegionInfo() expectations to fail.
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
namespace {
|
||||
|
||||
void GetRegionInfo(vm_address_t* region_address, vm_size_t* region_size) {
|
||||
@ -230,5 +229,4 @@ TEST(ScopedMachVMTest, ResetMustBeAligned) {
|
||||
#endif // DCHECK_IS_ON()
|
||||
|
||||
} // namespace
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -13,8 +13,7 @@
|
||||
class NSAutoreleasePool;
|
||||
#endif // __OBJC__
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// ScopedNSAutoreleasePool allocates an NSAutoreleasePool when instantiated and
|
||||
// sends it a -drain message when destroyed. This allows an autorelease pool to
|
||||
@ -41,7 +40,6 @@ class BASE_EXPORT ScopedNSAutoreleasePool {
|
||||
NSAutoreleasePool* autorelease_pool_;
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_NSAUTORELEASE_POOL_H_
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#include "base/check.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
ScopedNSAutoreleasePool::ScopedNSAutoreleasePool()
|
||||
: autorelease_pool_([[NSAutoreleasePool alloc] init]) {
|
||||
@ -28,5 +27,4 @@ void ScopedNSAutoreleasePool::Recycle() {
|
||||
DCHECK(autorelease_pool_);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "base/base_export.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
// Within a given scope, swaps method implementations of a class interface, or
|
||||
// between two class interfaces. The argument and return types must match.
|
||||
@ -53,7 +52,6 @@ class BASE_EXPORT ScopedObjCClassSwizzler {
|
||||
Method new_selector_impl_;
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_OBJC_CLASS_SWIZZLER_H_
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#include "base/check_op.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
ScopedObjCClassSwizzler::ScopedObjCClassSwizzler(Class target,
|
||||
Class source,
|
||||
@ -67,5 +66,4 @@ void ScopedObjCClassSwizzler::Init(Class target,
|
||||
method_exchangeImplementations(old_selector_impl_, new_selector_impl_);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -73,8 +73,7 @@
|
||||
}
|
||||
@end
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
TEST(ObjCClassSwizzlerTest, SwizzleInstanceMethods) {
|
||||
base::scoped_nsobject<ObjCClassSwizzlerTestOne> object_one(
|
||||
@ -155,5 +154,4 @@ TEST(ObjCClassSwizzlerTest, SwizzleViaInheritance) {
|
||||
EXPECT_EQ(3, [child method]);
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -24,8 +24,7 @@
|
||||
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
|
||||
@end
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
class BASE_EXPORT ScopedSendingEvent {
|
||||
public:
|
||||
@ -43,7 +42,6 @@ class BASE_EXPORT ScopedSendingEvent {
|
||||
BOOL handling_; // Value of -[app_ handlingSendEvent] at construction.
|
||||
};
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
||||
#endif // BASE_MAC_SCOPED_SENDING_EVENT_H_
|
||||
|
@ -6,8 +6,7 @@
|
||||
|
||||
#include "base/check.h"
|
||||
|
||||
namespace base {
|
||||
namespace mac {
|
||||
namespace base::mac {
|
||||
|
||||
ScopedSendingEvent::ScopedSendingEvent()
|
||||
: app_(static_cast<NSObject<CrAppControlProtocol>*>(NSApp)) {
|
||||
@ -20,5 +19,4 @@ ScopedSendingEvent::~ScopedSendingEvent() {
|
||||
[app_ setHandlingSendEvent:handling_];
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
} // namespace base
|
||||
} // namespace base::mac
|
||||
|
@ -4,6 +4,7 @@ Checks: '-*,
|
||||
google-build-namespaces,
|
||||
google-readability-namespace-comments,
|
||||
modernize-avoid-bind,
|
||||
modernize-concat-nested-namespaces,
|
||||
modernize-make-shared,
|
||||
modernize-make-unique,
|
||||
modernize-redundant-void-arg,
|
||||
|
@ -382,6 +382,23 @@ Banned because `<chrono>` is banned.
|
||||
|
||||
The following C++17 language features are allowed in the Chromium codebase.
|
||||
|
||||
### Nested namespaces <sup>[allowed]</sup>
|
||||
|
||||
```c++
|
||||
namespace A::B::C { ...
|
||||
```
|
||||
|
||||
**Description:** Using the namespace resolution operator to create nested
|
||||
namespace definitions.
|
||||
|
||||
**Documentation:**
|
||||
[Namespaces](https://en.cppreference.com/w/cpp/language/namespace)
|
||||
|
||||
**Notes:**
|
||||
*** promo
|
||||
[Discussion thread](https://groups.google.com/a/chromium.org/g/cxx/c/gLdR3apDSmg/)
|
||||
***
|
||||
|
||||
### Template argument deduction for class templates <sup>[allowed]</sup>
|
||||
|
||||
```c++
|
||||
@ -685,23 +702,6 @@ variable, such that it does not need to be initialized in the source file.
|
||||
None
|
||||
***
|
||||
|
||||
### Nested namespaces <sup>[tbd]</sup>
|
||||
|
||||
```c++
|
||||
namespace A::B::C { ...
|
||||
```
|
||||
|
||||
**Description:** Using the namespace resolution operator to create nested
|
||||
namespace definitions.
|
||||
|
||||
**Documentation:**
|
||||
[Namespaces](https://en.cppreference.com/w/cpp/language/namespace)
|
||||
|
||||
**Notes:**
|
||||
*** promo
|
||||
None
|
||||
***
|
||||
|
||||
### Structured bindings <sup>[tbd]</sup>
|
||||
|
||||
```c++
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
Checks: 'google-build-namespaces,
|
||||
google-readability-namespace-comments,
|
||||
modernize-concat-nested-namespaces,
|
||||
modernize-replace-auto-ptr,
|
||||
modernize-use-using'
|
||||
HeaderFilterRegex: 'ui/views/*'
|
||||
|
Reference in New Issue
Block a user