Loading system/gd/l2cap/classic/internal/fixed_channel_impl.cc +4 −4 Original line number Diff line number Diff line Loading @@ -73,12 +73,12 @@ void FixedChannelImpl::Acquire() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (acquired_) { log::info("{} was already acquired", ToLoggableStr(*this)); log::info("{} was already acquired", ToRedactedStringForLogging()); return; } acquired_ = true; Loading @@ -89,12 +89,12 @@ void FixedChannelImpl::Release() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (!acquired_) { log::info("{} was already released", ToLoggableStr(*this)); log::info("{} was already released", ToRedactedStringForLogging()); return; } acquired_ = false; Loading system/gd/l2cap/internal/fixed_channel_allocator.h +4 −4 Original line number Diff line number Diff line Loading @@ -52,14 +52,14 @@ public: // object is still owned by the channel allocator, NOT the client. virtual std::shared_ptr<FixedChannelImplType> AllocateChannel(Cid cid) { log::assert_that(!IsChannelAllocated(cid), "Cid 0x{:x} for link {} is already in use", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); log::assert_that(cid >= kFirstFixedChannel && cid <= kLastFixedChannel, "Cid {} out of bound", cid); auto elem = channels_.try_emplace( cid, std::make_shared<FixedChannelImplType>(cid, link_, l2cap_handler_)); log::assert_that(elem.second, "Failed to create channel for cid 0x{:x} link {}", cid, ToLoggableStr(*link_)); // TODO RENAME ADDRESS_TO_LOGGABLE_CSTR link_->ToRedactedStringForLogging()); log::assert_that(elem.first->second != nullptr, "assert failed: elem.first->second != nullptr"); return elem.first->second; } Loading @@ -67,7 +67,7 @@ public: // Frees a channel. If cid doesn't exist, it will crash virtual void FreeChannel(Cid cid) { log::assert_that(IsChannelAllocated(cid), "Channel is not in use: cid {}, link {}", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); channels_.erase(cid); } Loading @@ -76,7 +76,7 @@ public: virtual std::shared_ptr<FixedChannelImplType> FindChannel(Cid cid) { log::assert_that(IsChannelAllocated(cid), "Channel is not in use: cid {}, link {}", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); return channels_.find(cid)->second; } Loading system/gd/l2cap/le/internal/fixed_channel_impl.cc +4 −4 Original line number Diff line number Diff line Loading @@ -80,12 +80,12 @@ void FixedChannelImpl::Acquire() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (acquired_) { log::info("{} was already acquired", ToLoggableStr(*this)); log::info("{} was already acquired", ToRedactedStringForLogging()); return; } acquired_ = true; Loading @@ -96,12 +96,12 @@ void FixedChannelImpl::Release() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (!acquired_) { log::info("{} was already released", ToLoggableStr(*this)); log::info("{} was already released", ToRedactedStringForLogging()); return; } acquired_ = false; Loading system/gd/os/logging/log_adapter.h +1 −10 Original line number Diff line number Diff line Loading @@ -20,16 +20,7 @@ #include <string> // as RawAddress does not implement IRedactableLoggable // here we use a template function as a tricky workaround. // in the future. we want to convert it into a function // that takes a reference to IRedactableLoggable template <typename Loggable> std::string ToLoggableStr(const Loggable& loggable) { return loggable.ToRedactedStringForLogging(); } #define ADDRESS_TO_LOGGABLE_STR(addr) ToLoggableStr(addr) #define ADDRESS_TO_LOGGABLE_STR(addr) (addr).ToRedactedStringForLogging() #define ADDRESS_TO_LOGGABLE_CSTR(addr) ADDRESS_TO_LOGGABLE_STR(addr).c_str() #define PRIVATE_CELL(number) \ Loading Loading
system/gd/l2cap/classic/internal/fixed_channel_impl.cc +4 −4 Original line number Diff line number Diff line Loading @@ -73,12 +73,12 @@ void FixedChannelImpl::Acquire() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (acquired_) { log::info("{} was already acquired", ToLoggableStr(*this)); log::info("{} was already acquired", ToRedactedStringForLogging()); return; } acquired_ = true; Loading @@ -89,12 +89,12 @@ void FixedChannelImpl::Release() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (!acquired_) { log::info("{} was already released", ToLoggableStr(*this)); log::info("{} was already released", ToRedactedStringForLogging()); return; } acquired_ = false; Loading
system/gd/l2cap/internal/fixed_channel_allocator.h +4 −4 Original line number Diff line number Diff line Loading @@ -52,14 +52,14 @@ public: // object is still owned by the channel allocator, NOT the client. virtual std::shared_ptr<FixedChannelImplType> AllocateChannel(Cid cid) { log::assert_that(!IsChannelAllocated(cid), "Cid 0x{:x} for link {} is already in use", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); log::assert_that(cid >= kFirstFixedChannel && cid <= kLastFixedChannel, "Cid {} out of bound", cid); auto elem = channels_.try_emplace( cid, std::make_shared<FixedChannelImplType>(cid, link_, l2cap_handler_)); log::assert_that(elem.second, "Failed to create channel for cid 0x{:x} link {}", cid, ToLoggableStr(*link_)); // TODO RENAME ADDRESS_TO_LOGGABLE_CSTR link_->ToRedactedStringForLogging()); log::assert_that(elem.first->second != nullptr, "assert failed: elem.first->second != nullptr"); return elem.first->second; } Loading @@ -67,7 +67,7 @@ public: // Frees a channel. If cid doesn't exist, it will crash virtual void FreeChannel(Cid cid) { log::assert_that(IsChannelAllocated(cid), "Channel is not in use: cid {}, link {}", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); channels_.erase(cid); } Loading @@ -76,7 +76,7 @@ public: virtual std::shared_ptr<FixedChannelImplType> FindChannel(Cid cid) { log::assert_that(IsChannelAllocated(cid), "Channel is not in use: cid {}, link {}", cid, ToLoggableStr(*link_)); link_->ToRedactedStringForLogging()); return channels_.find(cid)->second; } Loading
system/gd/l2cap/le/internal/fixed_channel_impl.cc +4 −4 Original line number Diff line number Diff line Loading @@ -80,12 +80,12 @@ void FixedChannelImpl::Acquire() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (acquired_) { log::info("{} was already acquired", ToLoggableStr(*this)); log::info("{} was already acquired", ToRedactedStringForLogging()); return; } acquired_ = true; Loading @@ -96,12 +96,12 @@ void FixedChannelImpl::Release() { log::assert_that(user_handler_ != nullptr, "Must register OnCloseCallback before calling any methods"); if (closed_) { log::warn("{} is already closed", ToLoggableStr(*this)); log::warn("{} is already closed", ToRedactedStringForLogging()); log::assert_that(!acquired_, "assert failed: !acquired_"); return; } if (!acquired_) { log::info("{} was already released", ToLoggableStr(*this)); log::info("{} was already released", ToRedactedStringForLogging()); return; } acquired_ = false; Loading
system/gd/os/logging/log_adapter.h +1 −10 Original line number Diff line number Diff line Loading @@ -20,16 +20,7 @@ #include <string> // as RawAddress does not implement IRedactableLoggable // here we use a template function as a tricky workaround. // in the future. we want to convert it into a function // that takes a reference to IRedactableLoggable template <typename Loggable> std::string ToLoggableStr(const Loggable& loggable) { return loggable.ToRedactedStringForLogging(); } #define ADDRESS_TO_LOGGABLE_STR(addr) ToLoggableStr(addr) #define ADDRESS_TO_LOGGABLE_STR(addr) (addr).ToRedactedStringForLogging() #define ADDRESS_TO_LOGGABLE_CSTR(addr) ADDRESS_TO_LOGGABLE_STR(addr).c_str() #define PRIVATE_CELL(number) \ Loading