Revert "[Code Health] Replace raw pointer Buffer::data_ with raw_ptr"
This reverts commit e783032573
.
Reason for revert: Crash in android, see crbug.com/389957875
Original change's description:
> [Code Health] Replace raw pointer Buffer::data_ with raw_ptr
>
> Bug: 346694189
> Change-Id: I67f9f686d206e52916e7f674b21837043d09545f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6019877
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Garrett Beaty <gbeaty@google.com>
> Cr-Commit-Position: refs/heads/main@{#1401542}
Bug: 346694189, 389957875
Change-Id: I3d17f6d6806a0c0a4337bd442ae9956d4a365910
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6175900
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406980}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
f8849ddbca
commit
86686ee583
@ -73,7 +73,7 @@ size_t Buffer::Allocate(size_t num_bytes) {
|
||||
uint32_t new_size;
|
||||
MojoResult rv = MojoAppendMessageData(
|
||||
message_.value(), static_cast<uint32_t>(additional_bytes), nullptr, 0,
|
||||
nullptr, &data_.AsEphemeralRawAddr(), &new_size);
|
||||
nullptr, &data_, &new_size);
|
||||
DCHECK_EQ(MOJO_RESULT_OK, rv);
|
||||
message_payload_size_ = new_cursor;
|
||||
size_ = new_size;
|
||||
@ -100,8 +100,7 @@ bool Buffer::AttachHandles(std::vector<ScopedHandle>* handles) {
|
||||
uint32_t new_size = 0;
|
||||
MojoResult rv = MojoAppendMessageData(
|
||||
message_.value(), 0, reinterpret_cast<MojoHandle*>(handles->data()),
|
||||
static_cast<uint32_t>(handles->size()), nullptr,
|
||||
&data_.AsEphemeralRawAddr(), &new_size);
|
||||
static_cast<uint32_t>(handles->size()), nullptr, &data_, &new_size);
|
||||
if (rv != MOJO_RESULT_OK)
|
||||
return false;
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/raw_ptr_exclusion.h"
|
||||
#include "mojo/public/cpp/system/handle.h"
|
||||
#include "mojo/public/cpp/system/message.h"
|
||||
|
||||
@ -124,18 +124,9 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS_BASE) Buffer {
|
||||
|
||||
// The storage location and capacity currently backing |message_|. Owned by
|
||||
// the message object internally, not by this Buffer.
|
||||
// Dangling when running chromedriver_unittests on win-rel (this is not an
|
||||
// exhaustive list of failures, just ones that provided an easy to view
|
||||
// backtrace):
|
||||
// FetchUrlTest.ConnectionClose
|
||||
// FetchUrlTest.Http200
|
||||
// FetchUrlTest.HttpNon200
|
||||
// FetchUrlTest.NoServer
|
||||
// TestHttpServerTest.ResourceNotFound
|
||||
// TestHttpServerTest.SetDataForPath
|
||||
// TestHttpServerTest.Start
|
||||
// TODO: crbug.com/387315749 - Resolving dangling pointer
|
||||
raw_ptr<void, DanglingUntriaged> data_ = nullptr;
|
||||
// This field is not a raw_ptr<> because it was filtered by the rewriter for:
|
||||
// #union, #addr-of
|
||||
RAW_PTR_EXCLUSION void* data_ = nullptr;
|
||||
size_t size_ = 0;
|
||||
|
||||
// The current write offset into |data_| if this Buffer is being used for
|
||||
|
Reference in New Issue
Block a user