Skip to content

Commit

Permalink
[Network/SSL] Make |ScopedChapsLoadFixup| STACK_ALLOCATED()
Browse files Browse the repository at this point in the history
- Annotate |ScopedChapsLoadFixup| with STACK_ALLOCATED();
- Exclude |ScopedChapsLoadFixup::chaps_handle_| from raw pointer usage
  check.

I missed this field during the automatic rewrite crrev.com/c/4607774 .
Adding the exclusion annotation to make compilation success with
|is_component_build = true|.

Context: 
Change-Id: I425d34938b0cea68f3fdc23bc799791f97ff851f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4625702
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1159607}
  • Loading branch information
mikt authored and Chromium LUCI CQ committed Jun 19, 2023
1 parent a7f3ddf commit 3c73c95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crypto/chaps_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <secmodt.h>

#include "base/logging.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/stack_allocated.h"
#include "base/threading/scoped_blocking_call.h"
#include "crypto/scoped_nss_types.h"
#include "nss_util_internal.h"
Expand All @@ -22,13 +24,18 @@ const char kChapsModuleName[] = "Chaps";
const char kChapsPath[] = "libchaps.so";

class ScopedChapsLoadFixup {
STACK_ALLOCATED();

public:
ScopedChapsLoadFixup();
~ScopedChapsLoadFixup();

private:
#if defined(COMPONENT_BUILD)
void* chaps_handle_;
// This field stores a handle and is not a pointer to PA memory.
// Also, this class is always stack-allocated and visibility is limited.
// Hence no benefit from using raw_ptr<void>.
RAW_PTR_EXCLUSION void* chaps_handle_;
#endif
};

Expand Down

0 comments on commit 3c73c95

Please sign in to comment.