0

[BRP] Apply raw_ptr rewriter

Rewrites generated by running the raw_ptr rewriter (win/android)
on ecf579231e

PS1: generated rewrite
PS2-PS5: manual build fixes and additional exclusions
PS6: rebase

Binary-Size: This is a batch rewrite so size increase is unavoidable
Change-Id: I23b244e715d6dcf559ce2df9cc8dc97ec9227fca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4044201
Owners-Override: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074510}
This commit is contained in:
Keishi Hattori
2022-11-22 09:04:26 +00:00
committed by Chromium LUCI CQ
parent 236a4df99d
commit c1b0023f5a
302 changed files with 650 additions and 452 deletions
ash
base
cc
chrome
android
features
cablev2_authenticator
browser
accessibility
android
apps
platform_apps
api
browsing_data
device_identity
download
enterprise
extensions
feature_guide
first_party_sets
history_clusters
media
new_tab_page
password_manager
performance_manager
policy
profiles
resource_coordinator
safe_browsing
search_resumption
supervised_user
sync_file_system
ui
web_applications
webauthn
win
common
installer
services
test
chromedriver
media_router
utility
components
autofill
autofill_assistant
blocked_content
bookmarks
device_signals
dom_distiller
enterprise
feed
metrics
omnibox
optimization_guide
paint_preview
password_manager
permissions
policy
power_bookmarks
reporting
segmentation_platform
internal
signin
sync_bookmarks
translate
variations
viz
zoom
content
courgette
device
extensions
gpu
ipc
media
mojo/core
net
printing
remoting
sandbox
services
accessibility
audio
device
network
resource_coordinator
memory_instrumentation
tracing
public
video_capture
viz
public
cpp
tools/clang/rewrite_raw_ptr_fields
ui
weblayer/browser

@ -8,6 +8,7 @@
#include <cstdint>
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
namespace aura {
class Window;
@ -28,7 +29,7 @@ struct RootWindowSettings {
// RootWindowController for the root window. This may be NULL
// for the root window used for mirroring.
RootWindowController* controller;
raw_ptr<RootWindowController> controller;
};
// Initializes and returns RootWindowSettings for |root|.

@ -4,6 +4,7 @@
#include "base/containers/circular_deque.h"
#include "base/memory/raw_ptr.h"
#include "base/test/copy_only_int.h"
#include "base/test/move_only_int.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -41,7 +42,7 @@ class DestructorCounter {
~DestructorCounter() { ++(*counter_); }
private:
int* counter_;
raw_ptr<int> counter_;
};
} // namespace

@ -8,6 +8,7 @@
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -24,7 +25,7 @@ class DestructorCounter {
~DestructorCounter() { ++(*counter_); }
private:
int* counter_;
raw_ptr<int> counter_;
};
} // namespace

@ -14,6 +14,7 @@
#include "base/debug/dump_without_crashing.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_param_associator.h"
#include "base/metrics/field_trial_params.h"
@ -106,7 +107,7 @@ class EarlyFeatureAccessTracker {
Lock lock_;
// First feature to be accessed before FeatureList registration.
const Feature* feature_ GUARDED_BY(lock_) = nullptr;
raw_ptr<const Feature> feature_ GUARDED_BY(lock_) = nullptr;
// Whether AccessedFeature() should fail instantly.
bool fail_instantly_ GUARDED_BY(lock_) = false;
@ -868,7 +869,7 @@ void FeatureList::GetFeatureOverridesImpl(std::string* enable_overrides,
target_list->push_back('*');
target_list->append(entry.first);
if (entry.second.field_trial) {
auto* const field_trial = entry.second.field_trial;
auto* const field_trial = entry.second.field_trial.get();
target_list->push_back('<');
target_list->append(field_trial->trial_name());
if (include_group_name) {

@ -498,7 +498,7 @@ class BASE_EXPORT FeatureList {
// An optional associated field trial, which will be activated when the
// state of the feature is queried for the first time. Weak pointer to the
// FieldTrial object that is owned by the FieldTrialList singleton.
base::FieldTrial* field_trial;
raw_ptr<base::FieldTrial> field_trial;
// Specifies whether the feature's state is overridden by |field_trial|.
// If it's not, and |field_trial| is not null, it means it is simply an

@ -100,7 +100,7 @@ class BASE_EXPORT MessagePumpEpoll : public MessagePump,
// this entry. This is set immediately upon returning from epoll_wait() and
// cleared again immediately before dispatching to any registered interests,
// so long as this entry isn't destroyed in the interim.
epoll_event* active_event = nullptr;
raw_ptr<epoll_event> active_event = nullptr;
};
// State which lives on the stack within Run(), to support nested run loops.

@ -92,7 +92,7 @@ class BASE_EXPORT MessagePumpLibevent : public MessagePump,
friend class RefCounted<EpollInterest>;
~EpollInterest();
FdWatchController* const controller_;
const raw_ptr<FdWatchController> controller_;
const EpollInterestParams params_;
bool active_ = true;
bool was_controller_destroyed_ = false;

@ -903,7 +903,7 @@ class BASE_EXPORT DelayedPersistentAllocation {
// The underlying object that does the actual allocation of memory. Its
// lifetime must exceed that of all DelayedPersistentAllocation objects
// that use it.
PersistentMemoryAllocator* const allocator_;
const raw_ptr<PersistentMemoryAllocator> allocator_;
// The desired type and size of the allocated segment plus the offset
// within it for the defined request.
@ -918,7 +918,7 @@ class BASE_EXPORT DelayedPersistentAllocation {
// stored once the allocation is complete. If multiple delayed allocations
// share the same pointer then an allocation on one will amount to an
// allocation for all.
volatile std::atomic<Reference>* const reference_;
const raw_ptr<volatile std::atomic<Reference>> reference_;
// No DISALLOW_COPY_AND_ASSIGN as it's okay to copy/move these objects.
};

@ -6,6 +6,7 @@
#define BASE_PROFILER_FRAME_H_
#include "base/base_export.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/profiler/module_cache.h"
namespace base {
@ -27,7 +28,9 @@ struct BASE_EXPORT Frame {
uintptr_t instruction_pointer;
// The module information.
const ModuleCache::Module* module;
// `module` is not a raw_ptr<...> because it is used with gmock Field() that
// expects a raw pointer in V8UnwinderTest.UnwindThroughV8Frames.
RAW_PTR_EXCLUSION const ModuleCache::Module* module;
// This serves as a temporary way to pass function names from libunwindstack
// unwinder to tracing profiler. Not used by any other unwinder.

@ -397,7 +397,7 @@ void ExpectStackContains(const std::vector<Frame>& stack,
if (frame_it->instruction_pointer >=
reinterpret_cast<uintptr_t>(function_it->start) &&
frame_it->instruction_pointer <=
reinterpret_cast<uintptr_t>(function_it->end)) {
reinterpret_cast<uintptr_t>(function_it->end.get())) {
++function_it;
}
}
@ -443,7 +443,7 @@ void ExpectStackDoesNotContain(
if (frame.instruction_pointer >=
reinterpret_cast<uintptr_t>(function.start) &&
frame.instruction_pointer <=
reinterpret_cast<uintptr_t>(function.end)) {
reinterpret_cast<uintptr_t>(function.end.get())) {
seen_functions.insert(function);
}
}

@ -11,6 +11,7 @@
#include "base/base_export.h"
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/native_library.h"
#include "base/profiler/frame.h"
#include "base/profiler/sampling_profiler_thread_token.h"
@ -50,7 +51,7 @@ class TargetThread : public PlatformThread::Delegate {
// Addresses near the start and end of a function.
struct FunctionAddressRange {
const void* start;
const void* end;
raw_ptr<const void> end;
};
// Represents a stack unwind scenario to be sampled by the

@ -11,6 +11,7 @@
#include <vector>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -28,7 +29,7 @@ struct IntTraits {
freed_ints->push_back(value);
}
std::vector<int>* freed_ints;
raw_ptr<std::vector<int>> freed_ints;
};
using ScopedInt = ScopedGeneric<int, IntTraits>;
@ -187,8 +188,8 @@ struct TrackedIntTraits : public ScopedGenericOwnershipTracking {
owners->erase(it);
}
std::unordered_set<int>* freed;
OwnerMap* owners;
raw_ptr<std::unordered_set<int>> freed;
raw_ptr<OwnerMap> owners;
};
using ScopedTrackedInt = ScopedGeneric<int, TrackedIntTraits>;

@ -156,7 +156,7 @@ class BASE_EXPORT TaskAnnotator::LongTaskTracker {
void EmitReceivedIPCDetails(perfetto::EventContext& ctx);
// For tracking task duration
const TickClock* tick_clock_; // Not owned.
raw_ptr<const TickClock> tick_clock_; // Not owned.
TimeTicks task_start_time_;
// Tracing variables.
@ -173,7 +173,7 @@ class BASE_EXPORT TaskAnnotator::LongTaskTracker {
uint32_t (*ipc_method_info_)();
bool is_response_ = false;
PendingTask& pending_task_;
TaskAnnotator* task_annotator_;
raw_ptr<TaskAnnotator> task_annotator_;
};
} // namespace base

@ -357,7 +357,7 @@ class BASE_EXPORT ThreadController {
bool current_work_item_is_native_ = true;
// non-null when recording is enabled.
HistogramBase* histogram_ = nullptr;
raw_ptr<HistogramBase> histogram_ = nullptr;
#if BUILDFLAG(ENABLE_BASE_TRACING)
absl::optional<perfetto::Track> perfetto_track_;
@ -397,7 +397,7 @@ class BASE_EXPORT ThreadController {
const raw_ref<TimeKeeper> time_keeper_;
// Must be set shortly before ~RunLevel.
LazyNow* exit_lazy_now_ = nullptr;
raw_ptr<LazyNow> exit_lazy_now_ = nullptr;
SampleMetadata thread_controller_sample_metadata_;
size_t thread_controller_active_id_ = 0;

@ -27,7 +27,7 @@ void WakeUpQueue::RemoveAllCanceledDelayedTasksFromFront(LazyNow* lazy_now) {
// needed because a different queue can become the top one once you remove the
// canceled tasks.
while (!wake_up_queue_.empty()) {
auto* top_queue = wake_up_queue_.top().queue;
auto* top_queue = wake_up_queue_.top().queue.get();
// If no tasks are removed from the top queue, then it means the top queue
// cannot change anymore.

@ -87,7 +87,7 @@ class BASE_EXPORT WakeUpQueue {
struct ScheduledWakeUp {
WakeUp wake_up;
internal::TaskQueueImpl* queue;
raw_ptr<internal::TaskQueueImpl> queue;
bool operator>(const ScheduledWakeUp& other) const {
return wake_up.latest_time() > other.wake_up.latest_time();

@ -15,6 +15,7 @@
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/aligned_memory.h"
#include "base/memory/raw_ptr.h"
#include "base/task/sequenced_task_runner.h"
namespace base::sequence_bound_internal {
@ -92,7 +93,7 @@ class Storage {
// AlignedAlloc() requires alignment be a multiple of sizeof(void*).
alloc_ = AlignedAlloc(
sizeof(T), sizeof(void*) > alignof(T) ? sizeof(void*) : alignof(T));
ptr_ = reinterpret_cast<Ptr>(alloc_);
ptr_ = reinterpret_cast<Ptr>(alloc_.get());
// Ensure that `ptr_` will be initialized.
CrossThreadTraits::PostTask(
@ -151,7 +152,7 @@ class Storage {
// Storage originally allocated by `AlignedAlloc()`. Maintained separately
// from `ptr_` since the original, unadjusted pointer needs to be passed to
// `AlignedFree()`.
void* alloc_ = nullptr;
raw_ptr<void> alloc_ = nullptr;
};
template <typename T, typename CrossThreadTraits>

@ -722,7 +722,7 @@ class NoArgsVoidReturn {
void set_loop(RunLoop* loop) { loop_ = loop; }
private:
RunLoop* loop_ = nullptr;
raw_ptr<RunLoop> loop_ = nullptr;
};
class NoArgsIntReturn {

@ -59,7 +59,7 @@ using base::trace_event::Backtrace;
using base::trace_event::StackFrame;
size_t hash<StackFrame>::operator()(const StackFrame& frame) const {
return hash<const void*>()(frame.value);
return hash<const void*>()(frame.value.get());
}
size_t hash<Backtrace>::operator()(const Backtrace& backtrace) const {

@ -11,6 +11,7 @@
#include <functional>
#include "base/base_export.h"
#include "base/memory/raw_ptr.h"
namespace base {
namespace trace_event {
@ -42,7 +43,7 @@ struct BASE_EXPORT StackFrame {
}
Type type;
const void* value;
raw_ptr<const void> value;
};
bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs);

@ -13,6 +13,7 @@
#include <functional>
#include "base/check_op.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@ -30,16 +31,16 @@ using LangToOffset = LanguageSelector::LangToOffset;
// targets of exceptions (where one language is mapped to another) or wildcards
// (where a raw language identifier is mapped to a specific localization).
struct AvailableLanguageAliases {
const LangToOffset* en_gb_language_offset;
const LangToOffset* en_us_language_offset;
const LangToOffset* es_language_offset;
const LangToOffset* es_419_language_offset;
const LangToOffset* fil_language_offset;
const LangToOffset* iw_language_offset;
const LangToOffset* no_language_offset;
const LangToOffset* pt_br_language_offset;
const LangToOffset* zh_cn_language_offset;
const LangToOffset* zh_tw_language_offset;
raw_ptr<const LangToOffset> en_gb_language_offset;
raw_ptr<const LangToOffset> en_us_language_offset;
raw_ptr<const LangToOffset> es_language_offset;
raw_ptr<const LangToOffset> es_419_language_offset;
raw_ptr<const LangToOffset> fil_language_offset;
raw_ptr<const LangToOffset> iw_language_offset;
raw_ptr<const LangToOffset> no_language_offset;
raw_ptr<const LangToOffset> pt_br_language_offset;
raw_ptr<const LangToOffset> zh_cn_language_offset;
raw_ptr<const LangToOffset> zh_tw_language_offset;
};
#if DCHECK_IS_ON()

@ -7,6 +7,7 @@
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/time/time.h"
#include "cc/cc_export.h"
@ -637,7 +638,7 @@ class CC_EXPORT InputHandler : public InputDelegateForCompositor {
// |scroll_node|. This can be nullptr if no layer was hit and there are no
// viewport nodes (e.g. OOPIF, UI compositor).
struct ScrollHitTestResult {
ScrollNode* scroll_node;
raw_ptr<ScrollNode> scroll_node;
bool hit_test_successful;
};
ScrollHitTestResult HitTestScrollNode(

@ -75,9 +75,9 @@ class CC_EXPORT EffectTreeLayerListIterator {
struct Position {
State state = State::END;
LayerImpl* current_layer = nullptr;
RenderSurfaceImpl* current_render_surface = nullptr;
RenderSurfaceImpl* target_render_surface = nullptr;
raw_ptr<LayerImpl> current_layer = nullptr;
raw_ptr<RenderSurfaceImpl> current_render_surface = nullptr;
raw_ptr<RenderSurfaceImpl> target_render_surface = nullptr;
};
operator const Position() const {

@ -217,17 +217,17 @@ class CC_PAINT_EXPORT PaintOp {
std::vector<uint8_t>* scratch_buffer,
bool is_privileged,
SharedImageProvider* shared_image_provider);
TransferCacheDeserializeHelper* transfer_cache = nullptr;
ServicePaintCache* paint_cache = nullptr;
SkStrikeClient* strike_client = nullptr;
raw_ptr<TransferCacheDeserializeHelper> transfer_cache = nullptr;
raw_ptr<ServicePaintCache> paint_cache = nullptr;
raw_ptr<SkStrikeClient> strike_client = nullptr;
// Do a DumpWithoutCrashing when serialization fails.
bool crash_dump_on_failure = false;
// Used to memcpy Skia flattenables into to avoid TOCTOU issues.
std::vector<uint8_t>* scratch_buffer = nullptr;
raw_ptr<std::vector<uint8_t>> scratch_buffer = nullptr;
// True if the deserialization is happening on a privileged gpu channel.
// e.g. in the case of UI.
bool is_privileged = false;
SharedImageProvider* shared_image_provider = nullptr;
raw_ptr<SharedImageProvider> shared_image_provider = nullptr;
};
// Indicates how PaintImages are serialized.

@ -10,6 +10,7 @@
#include <string>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "cc/cc_export.h"
@ -131,8 +132,8 @@ struct CC_EXPORT TaskGraph {
Edge(const Task* task, Task* dependent)
: task(task), dependent(dependent) {}
const Task* task;
Task* dependent;
raw_ptr<const Task> task;
raw_ptr<Task> dependent;
};
TaskGraph();

@ -82,7 +82,7 @@ class DependentIterator {
// Now find the node for the dependent of this edge.
auto it = base::ranges::find(graph_->nodes,
graph_->edges[current_index_].dependent,
graph_->edges[current_index_].dependent.get(),
&TaskGraph::Node::task);
DCHECK(it != graph_->nodes.end());
current_node_ = &(*it);
@ -178,7 +178,7 @@ void TaskGraphWorkQueue::ScheduleTasks(NamespaceToken token, TaskGraph* graph) {
continue;
// Skip if already running.
if (base::Contains(task_namespace.running_tasks, node.task,
if (base::Contains(task_namespace.running_tasks, node.task.get(),
&CategorizedTask::second)) {
continue;
}
@ -208,12 +208,12 @@ void TaskGraphWorkQueue::ScheduleTasks(NamespaceToken token, TaskGraph* graph) {
continue;
// Skip if already running.
if (base::Contains(task_namespace.running_tasks, node.task,
if (base::Contains(task_namespace.running_tasks, node.task.get(),
&CategorizedTask::second)) {
continue;
}
DCHECK(!base::Contains(task_namespace.completed_tasks, node.task));
DCHECK(!base::Contains(task_namespace.completed_tasks, node.task.get()));
node.task->state().DidCancel();
task_namespace.completed_tasks.push_back(node.task);
}

@ -65,7 +65,7 @@ base::flat_map<UIResourceId, gfx::Size> UIResourceManager::GetUIResourceSizes()
const {
base::flat_map<UIResourceId, gfx::Size>::container_type items(
ui_resource_client_map_.size());
for (const auto pair : ui_resource_client_map_)
for (const auto& pair : ui_resource_client_map_)
items.push_back({pair.first, pair.second.size});
return base::flat_map<UIResourceId, gfx::Size>(std::move(items));
}

@ -10,6 +10,7 @@
#include <vector>
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "cc/cc_export.h"
#include "cc/resources/ui_resource_request.h"
@ -67,7 +68,7 @@ class CC_EXPORT UIResourceManager {
private:
struct UIResourceClientData {
UIResourceClient* client;
raw_ptr<UIResourceClient> client;
gfx::Size size;
};

@ -10650,7 +10650,7 @@ class LayerTreeHostTestBeginFramePausedChanged : public LayerTreeHostTest {
}
private:
TestLayerTreeFrameSink* layer_tree_frame_sink_;
raw_ptr<TestLayerTreeFrameSink> layer_tree_frame_sink_;
};
MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFramePausedChanged);

@ -48,8 +48,8 @@ struct DataForRecursion {
bool animation_axis_aligned_since_render_target;
bool not_axis_aligned_since_last_clip;
gfx::Transform compound_transform_since_render_target;
bool* subtree_has_rounded_corner;
bool* subtree_has_gradient_mask;
raw_ptr<bool> subtree_has_rounded_corner;
raw_ptr<bool> subtree_has_gradient_mask;
};
class PropertyTreeBuilderContext {

@ -230,7 +230,7 @@ std::vector<uint8_t> JavaByteArrayToByteVector(
// there are ultimately only one human user, concurrent requests are not
// supported.
struct GlobalData {
JNIEnv* env = nullptr;
raw_ptr<JNIEnv> env = nullptr;
// instance_num is incremented for each new |Transaction| created and returned
// to Java to serve as a "handle". This prevents commands intended for a
// previous transaction getting applied to a replacement. The zero value is
@ -244,14 +244,14 @@ struct GlobalData {
absl::optional<std::array<uint8_t, device::cablev2::kRootSecretSize>>
root_secret;
network::mojom::NetworkContext* network_context = nullptr;
raw_ptr<network::mojom::NetworkContext> network_context = nullptr;
// event_to_record_if_stopped contains an event to record with UMA if the
// activity is stopped. This is updated as a transaction progresses.
absl::optional<CableV2MobileEvent> event_to_record_if_stopped;
// registration is a non-owning pointer to the global |Registration|.
device::cablev2::authenticator::Registration* registration = nullptr;
raw_ptr<device::cablev2::authenticator::Registration> registration = nullptr;
// current_transaction holds the |Transaction| that is currently active.
std::unique_ptr<device::cablev2::authenticator::Transaction>

@ -80,7 +80,7 @@ class AXScreenAIAnnotator : public KeyedService,
// AXScreenAIAnnotator is created by a factory on this browser context and
// will be destroyed before browser context gets destroyed.
content::BrowserContext* browser_context_;
raw_ptr<content::BrowserContext> browser_context_;
mojo::Remote<mojom::ScreenAIAnnotator> screen_ai_annotator_;
mojo::Receiver<mojom::ScreenAIAnnotatorClient> screen_ai_service_client_;

@ -30,7 +30,7 @@ class TabMatcherAndroid : public TabMatcher {
GURLToTabInfoMap GetAllHiddenAndNonCCTTabInfos(
const bool keep_search_intent_params) const;
const TemplateURLService* template_url_service_;
raw_ptr<const TemplateURLService> template_url_service_;
raw_ptr<Profile> profile_;
};

@ -33,7 +33,7 @@ struct WebContentsStateByteBuffer {
// needed. Outside of this scope, this struct is not meant to be used for any
// other purposes. Please do not attempt to use this struct anywhere else
// except for in the provided callstack/use case.
void* byte_buffer_data;
raw_ptr<void> byte_buffer_data;
int byte_buffer_size;
int state_version;
};

@ -57,8 +57,8 @@ class TabIterator {
const sessions::TabRestoreService::Entries& entries_;
sessions::TabRestoreService::Entries::const_iterator current_entry_;
const std::vector<std::unique_ptr<sessions::TabRestoreService::Tab>>* tabs_ =
nullptr;
raw_ptr<const std::vector<std::unique_ptr<sessions::TabRestoreService::Tab>>>
tabs_ = nullptr;
absl::optional<std::vector<std::unique_ptr<
sessions::TabRestoreService::Tab>>::const_reverse_iterator>
current_tab_ = absl::nullopt;

@ -110,8 +110,8 @@ struct ReturnWithFakeFileAddedStatusFunctor {
}
private:
GURL* origin_;
MockRemoteFileSyncService* mock_remote_service_;
raw_ptr<GURL> origin_;
raw_ptr<MockRemoteFileSyncService> mock_remote_service_;
sync_file_system::SyncFileType file_type_;
sync_file_system::SyncFileStatus sync_file_status_;
sync_file_system::SyncAction sync_action_taken_;

@ -717,7 +717,7 @@ class RemoveDIPSEventsTester {
}
private:
base::SequenceBound<DIPSStorage>* storage_;
raw_ptr<base::SequenceBound<DIPSStorage>> storage_;
};
class RemoveSecurePaymentConfirmationCredentialsTester {

@ -8,6 +8,7 @@
#include <string>
#include "base/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "build/chromeos_buildflags.h"
#include "google_apis/gaia/core_account_id.h"
@ -86,7 +87,7 @@ class DeviceOAuth2TokenStore {
Observer* observer() { return observer_; }
private:
Observer* observer_ = nullptr;
raw_ptr<Observer> observer_ = nullptr;
};
#endif // CHROME_BROWSER_DEVICE_IDENTITY_DEVICE_OAUTH2_TOKEN_STORE_H_

@ -71,7 +71,7 @@ class DownloadUIModel {
offline_items_collection::FailState fail_state) const;
// Unknowned model to create statuses.
DownloadUIModel* model_ = nullptr;
raw_ptr<DownloadUIModel> model_ = nullptr;
};
// Used in Download shelf and page, default option.

@ -6,6 +6,7 @@
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@ -41,7 +42,7 @@ struct TestParam {
const char* url;
const char* settings_value;
AnalysisSettings* expected_settings;
raw_ptr<AnalysisSettings> expected_settings;
};
constexpr char kNormalSettings[] = R"({

@ -9,6 +9,7 @@
#include <utility>
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
@ -116,7 +117,7 @@ class WinKeyNetworkDelegateTest : public testing::Test {
EXPECT_EQ(response_code, future.Get());
}
MockWinNetworkFetcherFactory* mock_network_fetcher_factory_ = nullptr;
raw_ptr<MockWinNetworkFetcherFactory> mock_network_fetcher_factory_ = nullptr;
std::unique_ptr<WinKeyNetworkDelegate> network_delegate_;
base::test::TaskEnvironment task_environment_{
base::test::TaskEnvironment::TimeSource::MOCK_TIME};

@ -10,6 +10,7 @@
#include "base/base64.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/network/mock_key_network_delegate.h"
@ -85,8 +86,8 @@ class RotateUtilTest : public testing::Test {
return command_line;
}
MockKeyNetworkDelegate* mock_network_delegate_;
MockKeyPersistenceDelegate* mock_persistence_delegate_;
raw_ptr<MockKeyNetworkDelegate> mock_network_delegate_;
raw_ptr<MockKeyPersistenceDelegate> mock_persistence_delegate_;
std::unique_ptr<KeyRotationManager> key_rotation_manager_;
test::ScopedKeyPersistenceDelegateFactory scoped_factory_;
base::test::TaskEnvironment task_environment_;

@ -5,6 +5,7 @@
#include <set>
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/enterprise/connectors/connectors_service.h"
@ -184,7 +185,7 @@ struct TestParam {
const char* url;
const char* settings_value;
std::set<std::string>* expected_mime_types;
raw_ptr<std::set<std::string>> expected_mime_types;
};
class FileSystemServiceSettingsTest : public testing::TestWithParam<TestParam> {

@ -7,6 +7,7 @@
#include <set>
#include <string>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.h"
#include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client_factory.h"
@ -122,7 +123,7 @@ class ExtensionInstallEventRouterTest : public testing::Test {
scoped_refptr<extensions::Extension> extension_chrome_;
ReportingSettings settings;
MockRealtimeReportingClient* mockRealtimeReportingClient_;
raw_ptr<MockRealtimeReportingClient> mockRealtimeReportingClient_;
std::unique_ptr<ExtensionInstallEventRouter> extensionInstallEventRouter_;
};

@ -6,6 +6,7 @@
#include "base/base64url.h"
#include "base/hash/sha1.h"
#include "base/memory/raw_ptr.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/enterprise/browser/identifiers/identifiers_prefs.h"
@ -108,7 +109,7 @@ class ProfileIdServiceFactoryTest : public testing::Test {
content::BrowserTaskEnvironment task_environment_;
TestingProfileManager profile_manager_;
raw_ptr<TestingProfile> profile_;
ProfileIdService* service_;
raw_ptr<ProfileIdService> service_;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA) || \
BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_ASH) && \

@ -49,7 +49,7 @@ class ActionRunner {
void OnActionFinished(ActionQueue remaining_actions, bool succeeded);
raw_ptr<Profile> profile_;
ActionFactory* action_factory_;
raw_ptr<ActionFactory> action_factory_;
base::WeakPtrFactory<ActionRunner> weak_ptr_factory_{this};
};

@ -4,6 +4,7 @@
#include "chrome/browser/enterprise/idle/action_runner.h"
#include "base/memory/raw_ptr.h"
#include "base/test/gmock_callback_support.h"
#include "chrome/browser/enterprise/idle/action.h"
#include "chrome/test/base/testing_profile.h"
@ -16,7 +17,7 @@ namespace enterprise_idle {
namespace {
struct RunEntry {
Profile* profile;
raw_ptr<Profile> profile;
base::flat_set<std::string> action_names;
};

@ -6,6 +6,7 @@
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "base/test/scoped_mock_time_message_loop_task_runner.h"
#include "base/test/task_environment.h"
@ -124,7 +125,7 @@ class IdleServiceTest : public InProcessBrowserTest {
}
private:
MockIdleTimeProvider* time_provider_ = nullptr;
raw_ptr<MockIdleTimeProvider> time_provider_ = nullptr;
scoped_refptr<base::TestMockTimeTaskRunner> task_runner_;
std::unique_ptr<ui::test::ScopedIdleProviderForTest> scoped_idle_provider_;
};

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/memory/raw_ptr.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h"
#include "chrome/browser/profiles/profile.h"
@ -38,7 +39,7 @@ class BookmarkManagerPrivateApiBrowsertest : public InProcessBrowserTest {
return model;
}
BookmarkModel* model_;
raw_ptr<BookmarkModel> model_;
};
IN_PROC_BROWSER_TEST_F(BookmarkManagerPrivateApiBrowsertest,

@ -5,6 +5,7 @@
#include <tuple>
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/signals/device_info_fetcher.h"
#include "chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.h"
@ -1350,7 +1351,7 @@ class UserContextGatedTest : public ExtensionApiUnittest {
enterprise_signals::features::kNewEvSignalsEnabled);
}
device_signals::MockSignalsAggregator* mock_aggregator_;
raw_ptr<device_signals::MockSignalsAggregator> mock_aggregator_;
base::test::ScopedFeatureList scoped_features_;
base::HistogramTester histogram_tester_;
};

@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_API_SIDE_PANEL_SIDE_PANEL_SERVICE_H_
#include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "chrome/common/extensions/api/side_panel.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
@ -50,7 +51,7 @@ class SidePanelService : public BrowserContextKeyedAPI,
private:
friend class BrowserContextKeyedAPIFactory<SidePanelService>;
content::BrowserContext* const browser_context_;
const raw_ptr<content::BrowserContext> browser_context_;
// BrowserContextKeyedAPI implementation.
static const char* service_name() { return "SidePanelService"; }

@ -735,7 +735,7 @@ class ExtensionActionRunnerWithUserHostControlsBrowserTest
private:
base::test::ScopedFeatureList feature_list_;
PermissionsManager* permissions_manager_;
raw_ptr<PermissionsManager> permissions_manager_;
};
// Tests changing user site settings when the extension has site access (which

@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/supports_user_data.h"
#include "chrome/browser/feature_guide/notifications/feature_type.h"
#include "chrome/browser/notifications/scheduler/public/notification_scheduler_client.h"
@ -77,7 +78,7 @@ class FeatureNotificationGuideService : public KeyedService,
virtual ~Delegate();
private:
FeatureNotificationGuideService* service_{nullptr};
raw_ptr<FeatureNotificationGuideService> service_{nullptr};
};
using NotificationDataCallback = base::OnceCallback<void(

@ -5,6 +5,7 @@
#include "chrome/browser/first_party_sets/first_party_sets_navigation_throttle.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
@ -67,7 +68,7 @@ class FirstPartySetsNavigationThrottleTest
base::test::ScopedFeatureList features_;
raw_ptr<content::RenderFrameHost> subframe_;
ScopedMockFirstPartySetsHandler first_party_sets_handler_;
FirstPartySetsPolicyService* service_;
raw_ptr<FirstPartySetsPolicyService> service_;
};
TEST_F(FirstPartySetsNavigationThrottleTest,

@ -5,6 +5,7 @@
#include "chrome/browser/first_party_sets/first_party_sets_policy_service.h"
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
@ -221,9 +222,9 @@ class FirstPartySetsPolicyServiceTest
private:
ScopedMockFirstPartySetsHandler first_party_sets_handler_;
std::unique_ptr<TestingProfileManager> profile_manager_;
Profile* profile_;
raw_ptr<Profile> profile_;
base::test::ScopedFeatureList features_;
FirstPartySetsPolicyService* service_;
raw_ptr<FirstPartySetsPolicyService> service_;
};
TEST_F(FirstPartySetsPolicyServiceTest, IsSiteInManagedSet_WithoutConfig) {

@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "content/public/browser/first_party_sets_handler.h"
#include "net/first_party_sets/first_party_sets_cache_filter.h"
#include "net/first_party_sets/first_party_sets_context_config.h"
@ -76,7 +77,7 @@ class ScopedMockFirstPartySetsHandler : public content::FirstPartySetsHandler {
}
private:
content::FirstPartySetsHandler* previous_;
raw_ptr<content::FirstPartySetsHandler> previous_;
net::GlobalFirstPartySets global_sets_;
net::FirstPartySetsContextConfig config_;
net::FirstPartySetsCacheFilter cache_filter_;

@ -8,6 +8,7 @@
#include <string>
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
#include "chrome/browser/profiles/profile.h"
@ -57,7 +58,7 @@ class EntityImageService : public KeyedService {
ResultCallback callback,
const GURL& image_url);
Profile* const profile_;
const raw_ptr<Profile> profile_;
ChromeAutocompleteProviderClient autocomplete_provider_client_;
std::unique_ptr<unified_consent::UrlKeyedDataCollectionConsentHelper>

@ -834,7 +834,7 @@ class DelegatedFakeScreenCapturer
int ensure_hidden_call_count() const { return ensure_hidden_call_count_; }
private:
webrtc::DelegatedSourceListController::Observer* observer_ = nullptr;
raw_ptr<webrtc::DelegatedSourceListController::Observer> observer_ = nullptr;
int ensure_visible_call_count_ = 0;
int ensure_hidden_call_count_ = 0;
};

@ -8,6 +8,7 @@
#include <vector>
#include "base/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
@ -93,7 +94,7 @@ class FeedHandlerTest : public testing::Test {
protected:
std::unique_ptr<FeedHandler> handler_;
TestingProfile* profile_;
raw_ptr<TestingProfile> profile_;
content::BrowserTaskEnvironment task_environment_{
base::test::TaskEnvironment::TimeSource::MOCK_TIME};
variations::ScopedVariationsIdsProvider scoped_variations_ids_provider_{

@ -146,7 +146,7 @@ class ChromeWebAuthnCredentialsDelegateTest
#endif
protected:
ChromeWebAuthnCredentialsDelegate* credentials_delegate_;
raw_ptr<ChromeWebAuthnCredentialsDelegate> credentials_delegate_;
#if !BUILDFLAG(IS_ANDROID)
std::unique_ptr<ChromeAuthenticatorRequestDelegate>
authenticator_request_delegate_;

@ -57,7 +57,7 @@ class PageNodeSortProxy {
}
private:
const PageNode* page_node_;
raw_ptr<const PageNode> page_node_;
bool is_marked_;
bool is_protected_;
// Delta between current time and last visibility change time.

@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PERFORMANCE_MANAGER_TEST_SUPPORT_FAKE_FRAME_THROTTLING_DELEGATE_H_
#define CHROME_BROWSER_PERFORMANCE_MANAGER_TEST_SUPPORT_FAKE_FRAME_THROTTLING_DELEGATE_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/performance_manager/public/user_tuning/user_performance_tuning_manager.h"
namespace performance_manager {
@ -19,7 +20,7 @@ class FakeFrameThrottlingDelegate
explicit FakeFrameThrottlingDelegate(bool* throttling_enabled);
~FakeFrameThrottlingDelegate() override = default;
bool* throttling_enabled_;
raw_ptr<bool> throttling_enabled_;
};
} // namespace performance_manager

@ -4,6 +4,7 @@
#include "chrome/browser/performance_manager/public/user_tuning/user_performance_tuning_manager.h"
#include "base/memory/raw_ptr.h"
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_source.h"
#include "base/run_loop.h"
@ -132,7 +133,7 @@ class UserPerformanceTuningManagerTest : public testing::Test {
raw_ptr<base::test::TestBatteryLevelProvider> battery_level_provider_;
std::unique_ptr<base::BatteryStateSampler> battery_sampler_;
FakePowerMonitorSource* power_monitor_source_;
raw_ptr<FakePowerMonitorSource> power_monitor_source_;
bool throttling_enabled_ = false;
std::unique_ptr<UserPerformanceTuningManager> manager_;
};

@ -437,7 +437,7 @@ class QuicAllowedPolicyDynamicTest : public QuicTestBase {
// The first profile.
raw_ptr<Profile, DanglingUntriaged> profile_1_;
// The second profile. Only valid after CreateSecondProfile() has been called.
Profile* profile_2_;
raw_ptr<Profile> profile_2_;
// Mock Policy for profile_1_.
MockConfigurationPolicyProvider policy_for_profile_1_;

@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PROFILES_PROFILE_TESTING_HELPER_H_
#define CHROME_BROWSER_PROFILES_PROFILE_TESTING_HELPER_H_
#include "base/memory/raw_ptr.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "content/public/test/browser_task_environment.h"
@ -46,15 +47,15 @@ class ProfileTestingHelper {
content::BrowserTaskEnvironment task_environment_;
TestingProfileManager manager_;
TestingProfile* regular_profile_ = nullptr;
Profile* incognito_profile_ = nullptr;
raw_ptr<TestingProfile> regular_profile_ = nullptr;
raw_ptr<Profile> incognito_profile_ = nullptr;
TestingProfile* guest_profile_ = nullptr;
Profile* guest_profile_otr_ = nullptr;
raw_ptr<TestingProfile> guest_profile_ = nullptr;
raw_ptr<Profile> guest_profile_otr_ = nullptr;
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
TestingProfile* system_profile_ = nullptr;
Profile* system_profile_otr_ = nullptr;
raw_ptr<TestingProfile> system_profile_ = nullptr;
raw_ptr<Profile> system_profile_otr_ = nullptr;
#endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)

@ -8,6 +8,7 @@
#include <set>
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chrome/browser/resource_coordinator/tab_load_tracker.h"
@ -62,7 +63,7 @@ class TabMemoryMetricsReporter : public TabLoadTracker::Observer {
base::TimeTicks page_loaded_time;
base::TimeTicks next_emit_time;
ReportState state;
content::WebContents* web_contents;
raw_ptr<content::WebContents> web_contents;
};
struct WebContentsDataComparator {

@ -105,7 +105,7 @@ class StateStore {
raw_ptr<Profile> profile_;
// A read-only view on the profile's incidents_sent preference.
const base::Value::Dict* incidents_sent_ = nullptr;
raw_ptr<const base::Value::Dict> incidents_sent_ = nullptr;
#if DCHECK_IS_ON()
// True when a Transaction instance is outstanding.

@ -5,6 +5,7 @@
#include "chrome/browser/safe_browsing/tailored_security/chrome_tailored_security_service.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/prefs/browser_prefs.h"
@ -195,7 +196,7 @@ class ChromeTailoredSecurityServiceTest : public testing::Test {
std::unique_ptr<IdentityTestEnvironmentProfileAdaptor>
identity_test_env_adaptor_;
TestingProfileManager profile_manager_;
TestingProfile* profile_;
raw_ptr<TestingProfile> profile_;
std::unique_ptr<TestBrowserWindow> browser_window_;
std::unique_ptr<Browser> browser_;
std::unique_ptr<TestChromeTailoredSecurityService>

@ -10,6 +10,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "components/search/start_suggest_service.h"
@ -36,7 +37,7 @@ class SearchResumptionModuleBridge {
~SearchResumptionModuleBridge();
void OnSuggestionsReceived(std::vector<QuerySuggestion> suggestions);
StartSuggestService* start_suggest_service_;
raw_ptr<StartSuggestService> start_suggest_service_;
base::android::ScopedJavaGlobalRef<jobject> java_object_;
const base::WeakPtrFactory<SearchResumptionModuleBridge> weak_ptr_factory_{

@ -109,7 +109,7 @@ class FaviconFetcherTest : public ::testing::Test {
protected:
MockLargeIconService mock_large_icon_service_;
MockFaviconFetcher* favicon_fetcher_ =
raw_ptr<MockFaviconFetcher> favicon_fetcher_ =
new MockFaviconFetcher(&mock_large_icon_service_);
};

@ -11,6 +11,7 @@
#include "base/functional/callback.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/singleton.h"
@ -104,7 +105,8 @@ class KidsManagementService : public KeyedService,
void UpdateUserSignOutSetting();
#endif
Profile* profile_; // TODO(b/252793687): remove direct uses of the profile.
raw_ptr<Profile>
profile_; // TODO(b/252793687): remove direct uses of the profile.
const raw_ref<signin::IdentityManager> identity_manager_;
const raw_ref<SupervisedUserService> supervised_user_service_;
KidsProfileManager profile_manager_;

@ -8,6 +8,7 @@
#include <memory>
#include <string>
#include "base/memory/raw_ptr.h"
#include "base/strings/string_piece_forward.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
@ -123,12 +124,12 @@ class KidsManagementServiceTest : public ::testing::Test {
network::TestURLLoaderFactory test_url_loader_factory_;
std::unique_ptr<TestingProfile> profile_ =
MakeTestingProfile(test_url_loader_factory_);
KidsManagementService* under_test_ =
raw_ptr<KidsManagementService> under_test_ =
KidsManagementServiceFactory::GetForProfile(profile_.get());
IdentityTestEnvironmentProfileAdaptor
identity_test_environment_profile_adaptor_{
profile_.get()}; // Must be owned by test fixture.
IdentityTestEnvironment* identity_test_environment{
raw_ptr<IdentityTestEnvironment> identity_test_environment{
identity_test_environment_profile_adaptor_.identity_test_env()};
};

@ -38,6 +38,8 @@ KidsProfileManager::KidsProfileManager(PrefService& pref_service,
pref_service_(pref_service),
profile_(profile) {}
KidsProfileManager::~KidsProfileManager() {}
bool KidsProfileManager::IsChildAccount() const {
return profile_
->IsChild(); // TODO(b/252793687): Use AccountInfo.is_child_account ==
@ -82,6 +84,8 @@ KidsProfileManager::Custodian::Custodian(KidsProfileManager* manager,
profileURL_(manager, profileURL_property_path),
imageURL_(manager, imageURL_property_path) {}
KidsProfileManager::Custodian::~Custodian() {}
void KidsProfileManager::Custodian::Clear() {
name_.Clear();
email_.Clear();

@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SUPERVISED_USER_KIDS_CHROME_MANAGEMENT_KIDS_PROFILE_MANAGER_H_
#define CHROME_BROWSER_SUPERVISED_USER_KIDS_CHROME_MANAGEMENT_KIDS_PROFILE_MANAGER_H_
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/strings/string_piece.h"
#include "chrome/browser/profiles/profile.h"
@ -25,7 +26,7 @@ class KidsProfileManager {
bool GetBool() const;
private:
KidsProfileManager* manager_;
raw_ptr<KidsProfileManager> manager_;
base::StringPiece property_path_;
};
@ -40,6 +41,7 @@ class KidsProfileManager {
base::StringPiece gaiaID_property_path,
base::StringPiece profileURL_property_path,
base::StringPiece imageURL_property_path);
~Custodian();
void Clear();
void Update(const kids_chrome_management::FamilyMember& family_member);
@ -55,6 +57,7 @@ class KidsProfileManager {
KidsProfileManager(PrefService& pref_service,
Profile& profile);
~KidsProfileManager();
void UpdateChildAccountStatus(bool is_child_account);
bool IsChildAccountStatusKnown() const;
bool IsChildAccount() const;

@ -11,6 +11,7 @@
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
@ -119,7 +120,7 @@ struct PostStatusAndRecordChangeFunctor {
private:
SyncStatusCode status_;
std::vector<FileChange>* changes_;
raw_ptr<std::vector<FileChange>> changes_;
};
} // namespace

@ -7,6 +7,7 @@
#include "base/callback_list.h"
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/field_trial_params.h"
@ -167,7 +168,7 @@ class ItemSuggestCache {
// List of callbacks to run when results are updated.
OnResultsCallbackList on_results_callback_list_;
Profile* profile_;
raw_ptr<Profile> profile_;
std::unique_ptr<signin::PrimaryAccountAccessTokenFetcher> token_fetcher_;
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
std::unique_ptr<network::SimpleURLLoader> url_loader_;

@ -6,6 +6,7 @@
#include <stddef.h>
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
@ -37,7 +38,7 @@ struct RecentlyUsedFoldersComboModel::Item {
bool operator==(const Item& item) const;
const BookmarkNode* node;
raw_ptr<const BookmarkNode> node;
Type type;
};
@ -229,7 +230,7 @@ void RecentlyUsedFoldersComboModel::MaybeChangeParent(const BookmarkNode* node,
}
const BookmarkNode* RecentlyUsedFoldersComboModel::GetNodeAt(size_t index) {
return (index < items_.size()) ? items_[index].node : nullptr;
return (index < items_.size()) ? items_[index].node.get() : nullptr;
}
void RecentlyUsedFoldersComboModel::RemoveNode(const BookmarkNode* node) {

@ -5,6 +5,7 @@
#include "chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h"
#include <memory>
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/fast_checkout/fast_checkout_view.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
@ -53,7 +54,7 @@ class TestFastCheckoutControllerImpl : public FastCheckoutControllerImpl {
FastCheckoutView* GetOrCreateView() override { return view_; }
private:
FastCheckoutView* view_;
raw_ptr<FastCheckoutView> view_;
};
} // namespace

@ -10,6 +10,7 @@
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/prefs/session_startup_pref.h"
@ -66,7 +67,7 @@ struct StartupProfilePathInfo {
// TODO(https://crbug.com/1150326): return a guest profile for the Guest mode
// and return nullptr for kProfilePicker.
struct StartupProfileInfo {
Profile* profile;
raw_ptr<Profile> profile;
StartupProfileMode mode;
};

@ -96,8 +96,8 @@ class MockTabStripModelObserver : public TabStripModelObserver {
TabStripModelObserverAction action)
: dst_contents(dst_contents), dst_index(dst_index), action(action) {}
WebContents* src_contents = nullptr;
WebContents* dst_contents;
raw_ptr<WebContents> src_contents = nullptr;
raw_ptr<WebContents> dst_contents;
absl::optional<size_t> src_index;
absl::optional<size_t> dst_index;
int change_reason = CHANGE_REASON_NONE;

@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/chromeos_buildflags.h"
@ -110,7 +111,7 @@ class UninstallCheckboxView : public views::View,
views::Checkbox* checkbox() { return checkbox_; }
private:
views::Checkbox* checkbox_;
raw_ptr<views::Checkbox> checkbox_;
std::unique_ptr<CheckboxTargeter> checkbox_targeter_;
};

@ -57,7 +57,7 @@ class ApcScrimManagerImplTest : public TestWithBrowserView {
private:
std::unique_ptr<TestApcScrimManagerImpl> apc_scrim_manager_;
content::WebContents* web_contents_;
raw_ptr<content::WebContents> web_contents_;
};
TEST_F(ApcScrimManagerImplTest,

@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_ASSISTANT_PASSWORD_CHANGE_PASSWORD_CHANGE_ANIMATED_ICON_H_
#include "base/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "components/autofill_assistant/browser/public/password_change/proto/actions.pb.h"
#include "ui/gfx/animation/animation_delegate.h"
@ -75,7 +76,7 @@ class PasswordChangeAnimatedIcon : public gfx::LinearAnimation,
bool animation_ended_ = true;
// A raw pointer to the delegate for this icon that must outlive `this`.
Delegate* delegate_;
raw_ptr<Delegate> delegate_;
};
#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_ASSISTANT_PASSWORD_CHANGE_PASSWORD_CHANGE_ANIMATED_ICON_H_

@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
@ -90,7 +91,7 @@ class BookmarkBubbleViewBrowserTest : public DialogBrowserTest {
}
private:
commerce::MockShoppingService* mock_shopping_service_;
raw_ptr<commerce::MockShoppingService> mock_shopping_service_;
base::test::ScopedFeatureList test_features_;
};

@ -58,7 +58,7 @@ class ExtensionsToolbarButton : public ToolbarButton,
// This can be nullptr before ExtensionsTabbedMenu is fully rolled out.
// TODO(crbug.com/1279986): Remove this disclaimer once ExtensionsTabbedMenu
// is rolled out.
ExtensionsTabbedMenuCoordinator* extensions_tabbed_menu_coordinator_;
raw_ptr<ExtensionsTabbedMenuCoordinator> extensions_tabbed_menu_coordinator_;
};
#endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSIONS_TOOLBAR_BUTTON_H_

@ -921,7 +921,7 @@ class ExtensionsToolbarContainerFeatureUITest
private:
base::test::ScopedFeatureList scoped_feature_list_;
content::WebContents* web_contents_ = nullptr;
raw_ptr<content::WebContents> web_contents_ = nullptr;
};
// Tests that clicking the request access button grants one time access to the

@ -237,7 +237,7 @@ class BrowserViewLayoutTest : public ChromeViewsTestBase {
}
private:
BrowserViewLayout* layout_;
raw_ptr<BrowserViewLayout> layout_;
raw_ptr<MockBrowserViewLayoutDelegate> delegate_; // Owned by |layout_|.
std::unique_ptr<views::View> browser_view_;

@ -95,8 +95,8 @@ class InterpolatingLayoutManager : public views::LayoutManagerBase {
// Describes an interpolation between two layouts as a pointer to each and
// a percentage of distance between them to interpolate linearly to.
struct LayoutInterpolation {
LayoutManagerBase* first = nullptr;
LayoutManagerBase* second = nullptr;
raw_ptr<LayoutManagerBase> first = nullptr;
raw_ptr<LayoutManagerBase> second = nullptr;
// The closer this number is to zero, the more of |first| is used; the
// closer to 1.0f, the more of |second|. If the value is 0, |second| may be

@ -40,7 +40,7 @@ class MediaRemotingDialogCoordinatorViews
bool IsShowing() const override;
private:
content::WebContents* const web_contents_;
const raw_ptr<content::WebContents> web_contents_;
views::ViewTracker tracker_;
};

@ -1134,7 +1134,7 @@ class PageInfoBubbleViewBrowserTestCookiesSubpage
private:
base::test::ScopedFeatureList feature_list_;
PrefService* prefs_;
raw_ptr<PrefService> prefs_;
raw_ptr<MockPrivacySandboxService, DanglingUntriaged>
mock_privacy_sandbox_service_;
};

@ -49,7 +49,7 @@ class PermissionPromptChip : public PermissionPromptDesktop {
private:
// The controller handling the chip view
ChipController* chip_controller_;
raw_ptr<ChipController> chip_controller_;
// Delegate representing a permission request
raw_ptr<permissions::PermissionPrompt::Delegate> delegate_;

@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_POLICY_IDLE_DIALOG_VIEW_H_
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chrome/browser/ui/idle_dialog.h"
@ -84,7 +85,7 @@ class IdleDialogImpl : public IdleDialog, public views::WidgetObserver {
void OnWidgetDestroying(views::Widget* widget) override;
private:
views::Widget* widget_;
raw_ptr<views::Widget> widget_;
};
} // namespace policy

@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/profiles/profile_management_step_controller.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/profile.h"
@ -199,7 +200,7 @@ class FinishSamlSignInStepController : public ProfileManagementStepController {
}
std::unique_ptr<ScopedProfileKeepAlive> profile_keep_alive_;
Profile* profile_;
raw_ptr<Profile> profile_;
std::unique_ptr<content::WebContents> contents_;
absl::optional<SkColor> profile_color_;
FinishFlowCallback finish_flow_callback_;

@ -192,7 +192,7 @@ class ProfileMenuViewTestBase {
}
private:
Browser* target_browser_ = nullptr;
raw_ptr<Browser> target_browser_ = nullptr;
};
class ProfileMenuViewExtensionsTest : public ProfileMenuViewTestBase,

@ -7,6 +7,7 @@
#include <vector>
#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/test/bind.h"
#include "chrome/browser/image_editor/image_editor_component_info.h"
#include "chrome/browser/share/share_features.h"
@ -98,8 +99,8 @@ class ScreenshotCapturedBubbleTest : public ChromeViewsTestBase {
content::WebContentsTester::CreateTestWebContents(&profile_, nullptr);
std::unique_ptr<views::Widget> anchor_widget_;
ScreenshotCapturedBubble* bubble_;
views::Widget* bubble_widget_;
raw_ptr<ScreenshotCapturedBubble> bubble_;
raw_ptr<views::Widget> bubble_widget_;
};
TEST_F(ScreenshotCapturedBubbleTest, EditNavigatesToImageEditorWebUI) {

@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/share/share_features.h"
@ -124,12 +125,12 @@ class SharingHubBubbleTest : public ChromeViewsTestBase {
private:
base::test::ScopedFeatureList feature_list_{share::kDesktopSharePreview};
sharing_hub::SharingHubBubbleViewImpl* bubble_;
raw_ptr<sharing_hub::SharingHubBubbleViewImpl> bubble_;
testing::NiceMock<sharing_hub::FakeSharingHubBubbleController> controller_{
kFirstPartyActions, kThirdPartyActions};
std::unique_ptr<views::Widget> anchor_widget_;
views::Widget* bubble_widget_;
raw_ptr<views::Widget> bubble_widget_;
};
TEST_F(SharingHubBubbleTest, AllFirstPartyActionsAppearInOrder) {

@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_WEBVIEW_WEBVIEW_SIDE_PANEL_COORDINATOR_H_
#define CHROME_BROWSER_UI_VIEWS_SIDE_PANEL_WEBVIEW_WEBVIEW_SIDE_PANEL_COORDINATOR_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/browser_user_data.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/views/controls/textfield/textfield_controller.h"
@ -43,8 +44,8 @@ class WebViewSidePanelCoordinator
std::unique_ptr<views::View> CreateView();
views::Textfield* location_;
views::WebView* webview_;
raw_ptr<views::Textfield> location_;
raw_ptr<views::WebView> webview_;
BROWSER_USER_DATA_KEY_DECL();
};

@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/side_search/side_search_browser_controller.h"
#include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
@ -146,7 +147,7 @@ class DseImageView : public views::ImageView {
}
private:
Browser* const browser_;
const raw_ptr<Browser> browser_;
// Subscription to change notifications to the default search icon source.
base::CallbackListSubscription icon_changed_subscription_;

@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_TABS_Z_ORDERABLE_TAB_CONTAINER_ELEMENT_H_
#define CHROME_BROWSER_UI_VIEWS_TABS_Z_ORDERABLE_TAB_CONTAINER_ELEMENT_H_
#include "base/memory/raw_ptr.h"
namespace views {
class View;
}
@ -34,7 +36,7 @@ class ZOrderableTabContainerElement {
// on top of smaller ones.
static float CalculateZValue(views::View* child);
views::View* child_;
raw_ptr<views::View> child_;
float z_value_;
}; // ZOrderableTabContainerElement

@ -241,7 +241,7 @@ class PartialTranslateBubbleView : public LocationBarBubbleDelegateView,
raw_ptr<views::View, DanglingUntriaged> advanced_view_source_ = nullptr;
raw_ptr<views::View, DanglingUntriaged> advanced_view_target_ = nullptr;
views::Throbber* throbber_;
raw_ptr<views::Throbber> throbber_;
raw_ptr<views::Combobox, DanglingUntriaged> source_language_combobox_ =
nullptr;

Some files were not shown because too many files have changed in this diff Show More