0

Rewrite raw pointer fields to use raw_ptr<T> for linux

This reapplies the rewrite_raw_ptr_fields rewriter on Linux platform.

This change is a merge of the following changes:
PS1 raw_ptr rewrite generated by
    rewrite-multiple-platforms.sh linux
    on ae73da96bb
PS2 manual build fix by adding .get()
PS4 revert rewrite of ArrayDataViewImpl fields
PS6,PS8, PS11 manual build fix
      - add BreakpadInfo default constructor
      - fix nc test error message regex
      - Add missing .get()
PS13 Fix #include position

AX-Relnotes: n/a.
Bug: 1073933
Change-Id: I9fbb18f98fef4d55cf2ed74f0aab8d1db6f354a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3715469
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1016130}
This commit is contained in:
Keishi Hattori
2022-06-21 11:32:15 +00:00
committed by Chromium LUCI CQ
parent d05866fa70
commit f28f4f8f90
461 changed files with 1299 additions and 836 deletions
base
chrome
browser
test
utility
chromeos/components/feature_usage
components
content/browser
crypto
dbus
device
bluetooth
bluez
dbus
floss
test
udev_linux
extensions
browser
api
shell
gpu
media
mojo/public/cpp/bindings
net
printing
remoting/host
sandbox/policy/linux
services/device
ui
accessibility
aura
base
display
events
gfx
gl
gtk
ozone
common
demo
platform
headless
wayland
emulate
gpu
host
gtk_primary_selection_device_manager.hlinux_ui_delegate_wayland.horg_gnome_mutter_idle_monitor.horg_kde_kwin_idle.h
proxy
wayland_buffer_backing.hwayland_buffer_handle.hwayland_buffer_manager_connector.hwayland_buffer_manager_host.hwayland_clipboard.ccwayland_clipboard.hwayland_clipboard_unittest.ccwayland_connection.hwayland_connection_test_api.hwayland_cursor.hwayland_cursor_factory.hwayland_data_device.hwayland_data_device_base.hwayland_data_device_manager.hwayland_data_drag_controller.hwayland_data_source.hwayland_drm.hwayland_event_source.ccwayland_event_source.hwayland_event_source_unittest.ccwayland_event_watcher.hwayland_event_watcher_glib.ccwayland_event_watcher_glib.hwayland_frame_manager.ccwayland_frame_manager.hwayland_input_controller.ccwayland_input_method_context.hwayland_input_method_context_factory.hwayland_input_method_context_unittest.ccwayland_keyboard.ccwayland_keyboard.hwayland_keyboard_unittest.ccwayland_menu_utils.hwayland_output.hwayland_output_manager.hwayland_pointer.hwayland_pointer_unittest.ccwayland_screen.hwayland_screen_unittest.ccwayland_seat.hwayland_shm.hwayland_subsurface.hwayland_surface.ccwayland_surface.hwayland_toplevel_window.hwayland_touch.hwayland_touch_unittest.ccwayland_window.hwayland_window_drag_controller.hwayland_window_manager.ccwayland_window_manager.hwayland_window_manager_unittests.ccwayland_window_unittest.ccwayland_zaura_output_unittest.ccwayland_zaura_shell.ccwayland_zaura_shell.hwayland_zcr_cursor_shapes.hwayland_zcr_touchpad_haptics.hwayland_zwp_linux_dmabuf.hwayland_zwp_pointer_constraints.hwayland_zwp_pointer_gestures.hwayland_zwp_relative_pointer_manager.hxdg_foreign_wrapper.ccxdg_popup_wrapper_impl.hxdg_surface_wrapper_impl.hxdg_toplevel_wrapper_impl.hzwp_primary_selection_device_manager.hzwp_text_input_wrapper_v1.hzxdg_popup_v6_wrapper_impl.hzxdg_surface_v6_wrapper_impl.hzxdg_toplevel_v6_wrapper_impl.h
test
wayland_buffer_manager_unittest.ccwayland_utils.h
x11
public
platform_window
shell_dialogs
views
views_content_client

@@ -118,7 +118,7 @@ void WontCompile() {
no_ref_const_cb.Run(); no_ref_const_cb.Run();
} }
#elif defined(NCTEST_METHOD_BIND_RAW_PTR_RECEIVER_NEEDS_REFCOUNTED_OBJECT) // [r"fatal error: static_assert failed due to requirement '!IsPointerV<base::raw_ptr<base::NoRef, [^>]+>> \|\| IsRefCountedType<base::NoRef, void>::value' \"Receivers may not be raw pointers. If using a raw pointer here is safe and has no lifetime concerns, use base::Unretained\(\) and document why it's safe.\""] #elif defined(NCTEST_METHOD_BIND_RAW_PTR_RECEIVER_NEEDS_REFCOUNTED_OBJECT) // [r"fatal error: static_assert failed due to requirement '!IsPointerV<base::raw_ptr<base::NoRef, [^>]+>?>> \|\| IsRefCountedType<base::NoRef, void>::value' \"Receivers may not be raw pointers. If using a raw pointer here is safe and has no lifetime concerns, use base::Unretained\(\) and document why it's safe.\""]
// Method bound to non-refcounted object. // Method bound to non-refcounted object.
@@ -132,7 +132,7 @@ void WontCompile() {
no_ref_cb.Run(); no_ref_cb.Run();
} }
#elif defined(NCTEST_CONST_METHOD_BIND_RAW_PTR_RECEIVER_NEEDS_REFCOUNTED_OBJECT) // [r"fatal error: static_assert failed due to requirement '!IsPointerV<base::raw_ptr<base::NoRef, [^>]+>> \|\| IsRefCountedType<base::NoRef, void>::value' \"Receivers may not be raw pointers. If using a raw pointer here is safe and has no lifetime concerns, use base::Unretained\(\) and document why it's safe.\""] #elif defined(NCTEST_CONST_METHOD_BIND_RAW_PTR_RECEIVER_NEEDS_REFCOUNTED_OBJECT) // [r"fatal error: static_assert failed due to requirement '!IsPointerV<base::raw_ptr<base::NoRef, [^>]+>?>> \|\| IsRefCountedType<base::NoRef, void>::value' \"Receivers may not be raw pointers. If using a raw pointer here is safe and has no lifetime concerns, use base::Unretained\(\) and document why it's safe.\""]
// Const Method bound to non-refcounted object. // Const Method bound to non-refcounted object.
// //

@@ -4,6 +4,8 @@
#include "base/debug/dwarf_line_no.h" #include "base/debug/dwarf_line_no.h"
#include "base/memory/raw_ptr.h"
#ifdef USE_SYMBOLIZE #ifdef USE_SYMBOLIZE
#include "base/debug/buffered_dwarf_reader.h" #include "base/debug/buffered_dwarf_reader.h"
@@ -75,7 +77,7 @@ struct LineNumberRegisters {
virtual void Do(LineNumberRegisters* registers) = 0; virtual void Do(LineNumberRegisters* registers) = 0;
}; };
OnCommit* on_commit; raw_ptr<OnCommit> on_commit;
LineNumberRegisters(ProgramInfo info, OnCommit* on_commit) LineNumberRegisters(ProgramInfo info, OnCommit* on_commit)
: on_commit(on_commit), is_stmt(info.default_is_stmt) {} : on_commit(on_commit), is_stmt(info.default_is_stmt) {}
@@ -185,7 +187,7 @@ void EvaluateLineNumberProgram(const int fd,
// number for an address. // number for an address.
struct OnCommitImpl : public LineNumberRegisters::OnCommit { struct OnCommitImpl : public LineNumberRegisters::OnCommit {
private: private:
LineNumberInfo* info; raw_ptr<LineNumberInfo> info;
uint64_t module_relative_pc; uint64_t module_relative_pc;
const ProgramInfo& program_info; const ProgramInfo& program_info;

@@ -12,6 +12,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/debug/debugging_buildflags.h" #include "base/debug/debugging_buildflags.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#if BUILDFLAG(IS_POSIX) #if BUILDFLAG(IS_POSIX)
@@ -235,9 +236,9 @@ class BASE_EXPORT ScopedStackFrameLinker {
~ScopedStackFrameLinker(); ~ScopedStackFrameLinker();
private: private:
void* fp_; raw_ptr<void> fp_;
void* parent_fp_; raw_ptr<void> parent_fp_;
void* original_parent_fp_; raw_ptr<void> original_parent_fp_;
}; };
#endif // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) #endif // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)

@@ -25,6 +25,7 @@
#include <tuple> #include <tuple>
#include <vector> #include <vector>
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#if !defined(USE_SYMBOLIZE) #if !defined(USE_SYMBOLIZE)
@@ -491,7 +492,7 @@ class StreamBacktraceOutputHandler : public BacktraceOutputHandler {
void HandleOutput(const char* output) override { (*os_) << output; } void HandleOutput(const char* output) override { (*os_) << output; }
private: private:
std::ostream* os_; raw_ptr<std::ostream> os_;
}; };
void WarmUpBacktrace() { void WarmUpBacktrace() {

@@ -9,6 +9,7 @@
#include <math.h> #include <math.h>
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h" #include "base/notreached.h"
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
@@ -104,7 +105,7 @@ bool RunningOnMainThread() {
// around event handling. // around event handling.
struct WorkSource : public GSource { struct WorkSource : public GSource {
MessagePumpGlib* pump; raw_ptr<MessagePumpGlib> pump;
}; };
gboolean WorkSourcePrepare(GSource* source, gint* timeout_ms) { gboolean WorkSourcePrepare(GSource* source, gint* timeout_ms) {
@@ -133,8 +134,8 @@ GSourceFuncs WorkSourceFuncs = {WorkSourcePrepare, WorkSourceCheck,
WorkSourceDispatch, nullptr}; WorkSourceDispatch, nullptr};
struct FdWatchSource : public GSource { struct FdWatchSource : public GSource {
MessagePumpGlib* pump; raw_ptr<MessagePumpGlib> pump;
MessagePumpGlib::FdWatchController* controller; raw_ptr<MessagePumpGlib::FdWatchController> controller;
}; };
gboolean FdWatchSourcePrepare(GSource* source, gint* timeout_ms) { gboolean FdWatchSourcePrepare(GSource* source, gint* timeout_ms) {
@@ -161,7 +162,7 @@ GSourceFuncs g_fd_watch_source_funcs = {
} // namespace } // namespace
struct MessagePumpGlib::RunState { struct MessagePumpGlib::RunState {
Delegate* delegate; raw_ptr<Delegate> delegate;
// Used to flag that the current Run() invocation should return ASAP. // Used to flag that the current Run() invocation should return ASAP.
bool should_quit; bool should_quit;

@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include "base/base_export.h" #include "base/base_export.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump.h" #include "base/message_loop/message_pump.h"
#include "base/message_loop/watchable_io_message_pump_posix.h" #include "base/message_loop/watchable_io_message_pump_posix.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
@@ -62,12 +63,12 @@ class BASE_EXPORT MessagePumpGlib : public MessagePump,
void NotifyCanRead(); void NotifyCanRead();
void NotifyCanWrite(); void NotifyCanWrite();
FdWatcher* watcher_ = nullptr; raw_ptr<FdWatcher> watcher_ = nullptr;
GSource* source_ = nullptr; raw_ptr<GSource> source_ = nullptr;
std::unique_ptr<GPollFD> poll_fd_; std::unique_ptr<GPollFD> poll_fd_;
// If this pointer is non-null, the pointee is set to true in the // If this pointer is non-null, the pointee is set to true in the
// destructor. // destructor.
bool* was_destroyed_ = nullptr; raw_ptr<bool> was_destroyed_ = nullptr;
}; };
MessagePumpGlib(); MessagePumpGlib();
@@ -115,17 +116,17 @@ class BASE_EXPORT MessagePumpGlib : public MessagePump,
// separate between them in this structure type. // separate between them in this structure type.
struct RunState; struct RunState;
RunState* state_; raw_ptr<RunState> state_;
// This is a GLib structure that we can add event sources to. On the main // This is a GLib structure that we can add event sources to. On the main
// thread, we use the default GLib context, which is the one to which all GTK // thread, we use the default GLib context, which is the one to which all GTK
// events are dispatched. // events are dispatched.
GMainContext* context_ = nullptr; raw_ptr<GMainContext> context_ = nullptr;
bool context_owned_ = false; bool context_owned_ = false;
// The work source. It is shared by all calls to Run and destroyed when // The work source. It is shared by all calls to Run and destroyed when
// the message pump is destroyed. // the message pump is destroyed.
GSource* work_source_; raw_ptr<GSource> work_source_;
// We use a wakeup pipe to make sure we'll get out of the glib polling phase // We use a wakeup pipe to make sure we'll get out of the glib polling phase
// when another thread has scheduled us to do some work. There is a glib // when another thread has scheduled us to do some work. There is a glib

@@ -16,6 +16,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
@@ -108,7 +109,7 @@ class EventInjector {
}; };
struct Source : public GSource { struct Source : public GSource {
EventInjector* injector; raw_ptr<EventInjector> injector;
}; };
void AddEventHelper(int delay_ms, OnceClosure callback, OnceClosure task) { void AddEventHelper(int delay_ms, OnceClosure callback, OnceClosure task) {
@@ -139,7 +140,7 @@ class EventInjector {
return TRUE; return TRUE;
} }
Source* source_; raw_ptr<Source> source_;
std::vector<Event> events_; std::vector<Event> events_;
int processed_events_; int processed_events_;
static GSourceFuncs SourceFuncs; static GSourceFuncs SourceFuncs;
@@ -348,7 +349,7 @@ class ConcurrentHelper : public RefCounted<ConcurrentHelper> {
static const int kStartingEventCount = 20; static const int kStartingEventCount = 20;
static const int kStartingTaskCount = 20; static const int kStartingTaskCount = 20;
EventInjector* injector_; raw_ptr<EventInjector> injector_;
OnceClosure done_closure_; OnceClosure done_closure_;
int event_count_; int event_count_;
int task_count_; int task_count_;
@@ -598,7 +599,7 @@ class BaseWatcher : public MessagePumpGlib::FdWatcher {
void OnFileCanWriteWithoutBlocking(int /* fd */) override { NOTREACHED(); } void OnFileCanWriteWithoutBlocking(int /* fd */) override { NOTREACHED(); }
protected: protected:
MessagePumpGlib::FdWatchController* controller_; raw_ptr<MessagePumpGlib::FdWatchController> controller_;
}; };
class DeleteWatcher : public BaseWatcher { class DeleteWatcher : public BaseWatcher {

@@ -33,6 +33,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "base/process/environment_internal.h" #include "base/process/environment_internal.h"
@@ -127,9 +128,11 @@ typedef uint64_t kernel_sigset_t;
// This is what struct sigaction looks like to the kernel at least on X86 and // This is what struct sigaction looks like to the kernel at least on X86 and
// ARM. MIPS, for instance, is very different. // ARM. MIPS, for instance, is very different.
struct kernel_sigaction { struct kernel_sigaction {
void* k_sa_handler; // For this usage it only needs to be a generic pointer. raw_ptr<void>
k_sa_handler; // For this usage it only needs to be a generic pointer.
unsigned long k_sa_flags; unsigned long k_sa_flags;
void* k_sa_restorer; // For this usage it only needs to be a generic pointer. raw_ptr<void>
k_sa_restorer; // For this usage it only needs to be a generic pointer.
kernel_sigset_t k_sa_mask; kernel_sigset_t k_sa_mask;
}; };

@@ -10,6 +10,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
namespace logging { namespace logging {
@@ -84,8 +85,8 @@ class BASE_EXPORT ScopedVmoduleSwitches {
#if BUILDFLAG(USE_RUNTIME_VLOG) #if BUILDFLAG(USE_RUNTIME_VLOG)
// Creates a new instance of |VlogInfo| adding |vmodule_switch|. // Creates a new instance of |VlogInfo| adding |vmodule_switch|.
VlogInfo* CreateVlogInfoWithSwitches(const std::string& vmodule_switch); VlogInfo* CreateVlogInfoWithSwitches(const std::string& vmodule_switch);
VlogInfo* scoped_vlog_info_ = nullptr; raw_ptr<VlogInfo> scoped_vlog_info_ = nullptr;
VlogInfo* previous_vlog_info_ = nullptr; raw_ptr<VlogInfo> previous_vlog_info_ = nullptr;
#endif // BUILDFLAG(USE_RUNTIME_VLOG) #endif // BUILDFLAG(USE_RUNTIME_VLOG)
}; };
} // namespace logging } // namespace logging

@@ -93,7 +93,7 @@ class TestApcClientImpl : public ApcClientImpl {
std::unique_ptr<AssistantSidePanelCoordinator> side_panel_; std::unique_ptr<AssistantSidePanelCoordinator> side_panel_;
std::unique_ptr<autofill_assistant::HeadlessScriptController> std::unique_ptr<autofill_assistant::HeadlessScriptController>
external_script_controller_; external_script_controller_;
autofill_assistant::RuntimeManager* runtime_manager_; raw_ptr<autofill_assistant::RuntimeManager> runtime_manager_;
}; };
// static // static

@@ -10,6 +10,7 @@
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/i18n/time_formatting.h" #include "base/i18n/time_formatting.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h" #include "base/scoped_observation.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
@@ -279,7 +280,7 @@ class CertsSourcePlatformNSS : public CertificateManagerModel::CertsSource,
} }
// The source NSSCertDatabase used for listing certificates. // The source NSSCertDatabase used for listing certificates.
net::NSSCertDatabase* cert_db_; raw_ptr<net::NSSCertDatabase> cert_db_;
// ScopedObservation to keep track of the observer for net::CertDatabase. // ScopedObservation to keep track of the observer for net::CertDatabase.
base::ScopedObservation<net::CertDatabase, net::CertDatabase::Observer> base::ScopedObservation<net::CertDatabase, net::CertDatabase::Observer>

@@ -11,6 +11,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "chrome/browser/net/nss_service.h" #include "chrome/browser/net/nss_service.h"
@@ -269,7 +270,7 @@ class CertificateManagerModel {
CertificateManagerModel::Observer* observer, CertificateManagerModel::Observer* observer,
CreationCallback callback); CreationCallback callback);
net::NSSCertDatabase* cert_db_; raw_ptr<net::NSSCertDatabase> cert_db_;
// CertsSource instances providing certificates. The order matters - if a // CertsSource instances providing certificates. The order matters - if a
// certificate is provided by more than one CertsSource, only the first one is // certificate is provided by more than one CertsSource, only the first one is
@@ -279,7 +280,7 @@ class CertificateManagerModel {
bool hold_back_updates_ = false; bool hold_back_updates_ = false;
// The observer to notify when certificate list is refreshed. // The observer to notify when certificate list is refreshed.
Observer* observer_; raw_ptr<Observer> observer_;
}; };
#endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ #endif // CHROME_BROWSER_CERTIFICATE_MANAGER_MODEL_H_

@@ -10,6 +10,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/memory/memory_pressure_listener.h" #include "base/memory/memory_pressure_listener.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
@@ -119,7 +120,7 @@ class DbusMemoryPressureEvaluatorLinux
scoped_refptr<dbus::Bus> system_bus_; scoped_refptr<dbus::Bus> system_bus_;
scoped_refptr<dbus::Bus> session_bus_; scoped_refptr<dbus::Bus> session_bus_;
dbus::ObjectProxy* object_proxy_ = nullptr; raw_ptr<dbus::ObjectProxy> object_proxy_ = nullptr;
// The values used to determine how to translate LMM memory pressure levels to // The values used to determine how to translate LMM memory pressure levels to
// Chrome's are stored here, gathered from feature params. // Chrome's are stored here, gathered from feature params.

@@ -11,6 +11,7 @@
#include "base/memory/memory_pressure_listener.h" #include "base/memory/memory_pressure_listener.h"
#include "base/memory/memory_pressure_monitor.h" #include "base/memory/memory_pressure_monitor.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "base/time/time.h" #include "base/time/time.h"
@@ -144,7 +145,7 @@ class DbusMemoryPressureEvaluatorLinuxTest : public testing::Test {
scoped_refptr<dbus::MockObjectProxy> portal_proxy_; scoped_refptr<dbus::MockObjectProxy> portal_proxy_;
std::unique_ptr<DbusMemoryPressureEvaluatorLinux> evaluator_; std::unique_ptr<DbusMemoryPressureEvaluatorLinux> evaluator_;
MockMemoryPressureVoter* mock_voter_ = nullptr; raw_ptr<MockMemoryPressureVoter> mock_voter_ = nullptr;
std::vector<std::string> running_services_; std::vector<std::string> running_services_;
}; };

@@ -76,7 +76,7 @@ class CookieAccessObserver : public content::WebContentsObserver {
} }
private: private:
content::RenderFrameHost* const render_frame_host_; const raw_ptr<content::RenderFrameHost> render_frame_host_;
base::RunLoop run_loop_; base::RunLoop run_loop_;
}; };

@@ -6,6 +6,7 @@
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/download/download_confirmation_result.h" #include "chrome/browser/download/download_confirmation_result.h"
#include "components/download/public/common/download_item.h" #include "components/download/public/common/download_item.h"
#include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_dialog.h"
@@ -67,7 +68,7 @@ class DownloadFilePicker : public ui::SelectFileDialog::Listener,
scoped_refptr<ui::SelectFileDialog> select_file_dialog_; scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
// The item to be downloaded. // The item to be downloaded.
download::DownloadItem* download_item_; raw_ptr<download::DownloadItem> download_item_;
}; };
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_ #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_FILE_PICKER_H_

@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/supports_user_data.h" #include "base/supports_user_data.h"
#include "chrome/browser/enterprise/connectors/service_provider_config.h" #include "chrome/browser/enterprise/connectors/service_provider_config.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h" #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
@@ -89,7 +90,7 @@ struct CustomMessageData {
struct TagSettings { struct TagSettings {
CustomMessageData custom_message; CustomMessageData custom_message;
bool requires_justification = false; bool requires_justification = false;
const SupportedFiles* supported_files = nullptr; raw_ptr<const SupportedFiles> supported_files = nullptr;
}; };
// Structs representing settings to be used for an analysis or a report. These // Structs representing settings to be used for an analysis or a report. These

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

@@ -15,6 +15,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/containers/flat_map.h" #include "base/containers/flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/time/clock.h" #include "base/time/clock.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/crash/content/browser/error_reporting/js_error_report_processor.h" #include "components/crash/content/browser/error_reporting/js_error_report_processor.h"
@@ -198,7 +199,7 @@ class ChromeJsErrorReportProcessor : public JsErrorReportProcessor {
base::Time last_recent_error_reports_cleaning_; base::Time last_recent_error_reports_cleaning_;
// Clock for dependency injection. Not owned. // Clock for dependency injection. Not owned.
base::Clock* clock_; raw_ptr<base::Clock> clock_;
}; };
#endif // CHROME_BROWSER_ERROR_REPORTING_CHROME_JS_ERROR_REPORT_PROCESSOR_H_ #endif // CHROME_BROWSER_ERROR_REPORTING_CHROME_JS_ERROR_REPORT_PROCESSOR_H_

@@ -7,6 +7,7 @@
#include <set> #include <set>
#include "base/memory/raw_ptr.h"
#include "chrome/browser/extensions/global_shortcut_listener.h" #include "chrome/browser/extensions/global_shortcut_listener.h"
#include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/keycodes/keyboard_codes.h"
#include "ui/ozone/public/platform_global_shortcut_listener.h" #include "ui/ozone/public/platform_global_shortcut_listener.h"
@@ -52,8 +53,8 @@ class GlobalShortcutListenerOzone
std::set<ui::Accelerator> registered_hot_keys_; std::set<ui::Accelerator> registered_hot_keys_;
// The platform implementation. // The platform implementation.
ui::PlatformGlobalShortcutListener* platform_global_shortcut_listener_ = raw_ptr<ui::PlatformGlobalShortcutListener>
nullptr; platform_global_shortcut_listener_ = nullptr;
}; };
} // namespace extensions } // namespace extensions

@@ -25,6 +25,7 @@
#include "base/i18n/number_formatting.h" #include "base/i18n/number_formatting.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted_memory.h" #include "base/memory/ref_counted_memory.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h" #include "base/strings/escape.h"
@@ -1163,7 +1164,7 @@ class NotificationPlatformBridgeLinuxImpl
scoped_refptr<dbus::Bus> bus_; scoped_refptr<dbus::Bus> bus_;
dbus::ObjectProxy* notification_proxy_ = nullptr; raw_ptr<dbus::ObjectProxy> notification_proxy_ = nullptr;
std::unordered_set<std::string> capabilities_; std::unordered_set<std::string> capabilities_;

@@ -14,6 +14,7 @@
#include "base/callback_list.h" #include "base/callback_list.h"
#include "base/containers/contains.h" #include "base/containers/contains.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "base/process/kill.h" #include "base/process/kill.h"
@@ -276,8 +277,8 @@ class ShowItemHelper {
} }
scoped_refptr<dbus::Bus> bus_; scoped_refptr<dbus::Bus> bus_;
dbus::ObjectProxy* dbus_proxy_ = nullptr; raw_ptr<dbus::ObjectProxy> dbus_proxy_ = nullptr;
dbus::ObjectProxy* object_proxy_ = nullptr; raw_ptr<dbus::ObjectProxy> object_proxy_ = nullptr;
absl::optional<bool> prefer_filemanager_interface_; absl::optional<bool> prefer_filemanager_interface_;

@@ -65,6 +65,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/location.h" #include "base/location.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
@@ -550,7 +551,7 @@ class ProcessSingleton::LinuxWatcher
fd_watch_controller_; fd_watch_controller_;
// The ProcessSingleton::LinuxWatcher that owns us. // The ProcessSingleton::LinuxWatcher that owns us.
ProcessSingleton::LinuxWatcher* const parent_; const raw_ptr<ProcessSingleton::LinuxWatcher> parent_;
// A reference to the UI task runner. // A reference to the UI task runner.
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
@@ -606,7 +607,7 @@ class ProcessSingleton::LinuxWatcher
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
// The ProcessSingleton that owns us. // The ProcessSingleton that owns us.
ProcessSingleton* const parent_; const raw_ptr<ProcessSingleton> parent_;
std::set<std::unique_ptr<SocketReader>, base::UniquePtrComparator> readers_; std::set<std::unique_ptr<SocketReader>, base::UniquePtrComparator> readers_;
}; };

@@ -23,6 +23,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
@@ -264,7 +265,7 @@ class ProcessSingletonPosixTest : public testing::Test {
base::WaitableEvent signal_event_; base::WaitableEvent signal_event_;
std::unique_ptr<base::Thread> worker_thread_; std::unique_ptr<base::Thread> worker_thread_;
TestableProcessSingleton* process_singleton_on_thread_; raw_ptr<TestableProcessSingleton> process_singleton_on_thread_;
}; };
} // namespace } // namespace

@@ -196,7 +196,8 @@ bool FileAnalysisRequest::FileSupportedByDlp(
const std::string& mime_type) const { const std::string& mime_type) const {
for (const std::string& tag : content_analysis_request().tags()) { for (const std::string& tag : content_analysis_request().tags()) {
if (tag == "dlp" && tag_settings_.count("dlp")) { if (tag == "dlp" && tag_settings_.count("dlp")) {
const auto* supported_files = tag_settings_.at("dlp").supported_files; const auto* supported_files =
tag_settings_.at("dlp").supported_files.get();
return supported_files->FileExtensionSupported(file_name_) || return supported_files->FileExtensionSupported(file_name_) ||
supported_files->MimeTypeSupported(mime_type); supported_files->MimeTypeSupported(mime_type);
} }

@@ -1836,7 +1836,7 @@ class SSLUITestWithClientCert : public SSLUITestBase {
loop->Quit(); loop->Quit();
} }
net::NSSCertDatabase* cert_db_; raw_ptr<net::NSSCertDatabase> cert_db_;
}; };
// SSL client certificate tests are only enabled when using NSS for private key // SSL client certificate tests are only enabled when using NSS for private key

@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h" #include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
@@ -44,7 +45,7 @@ class FakeSyncGCMDriver : public instance_id::FakeGCMDriverForInstanceID {
EncryptMessageCallback callback) override; EncryptMessageCallback callback) override;
private: private:
Profile* profile_; raw_ptr<Profile> profile_;
}; };
#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SYNC_GCM_DRIVER_FOR_INSTANCE_ID_H_ #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SYNC_GCM_DRIVER_FOR_INSTANCE_ID_H_

@@ -5,6 +5,7 @@
#include "chrome/browser/themes/theme_service_aura_linux.h" #include "chrome/browser/themes/theme_service_aura_linux.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/custom_theme_supplier.h" #include "chrome/browser/themes/custom_theme_supplier.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
@@ -34,8 +35,8 @@ class SystemThemeLinux : public CustomThemeSupplier {
~SystemThemeLinux() override; ~SystemThemeLinux() override;
// These pointers are not owned by us. // These pointers are not owned by us.
views::LinuxUI* const linux_ui_; const raw_ptr<views::LinuxUI> linux_ui_;
PrefService* const pref_service_; const raw_ptr<PrefService> pref_service_;
}; };
SystemThemeLinux::SystemThemeLinux(PrefService* pref_service) SystemThemeLinux::SystemThemeLinux(PrefService* pref_service)

@@ -112,7 +112,7 @@ class ThemeProviderRedirectedEquivalenceLinuxTest : public ThemeServiceTest {
} }
protected: protected:
views::LinuxUI* linux_ui_; raw_ptr<views::LinuxUI> linux_ui_;
}; };
// TODO(crbug.com/1310397): There're mismatched colors in some Linux themes. // TODO(crbug.com/1310397): There're mismatched colors in some Linux themes.

@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_GLOBAL_MEDIA_CONTROLS_MEDIA_NOTIFICATION_DEVICE_MONITOR_H_ #define CHROME_BROWSER_UI_GLOBAL_MEDIA_CONTROLS_MEDIA_NOTIFICATION_DEVICE_MONITOR_H_
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/system/system_monitor.h" #include "base/system/system_monitor.h"
#include "build/build_config.h" #include "build/build_config.h"
@@ -82,7 +83,7 @@ class PollingDeviceMonitorImpl : public MediaNotificationDeviceMonitor {
media::AudioDeviceDescriptions descriptions); media::AudioDeviceDescriptions descriptions);
void NotifyObservers(); void NotifyObservers();
MediaNotificationDeviceProvider* const device_provider_; const raw_ptr<MediaNotificationDeviceProvider> device_provider_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
std::vector<std::string> device_ids_; std::vector<std::string> device_ids_;
bool is_task_posted_ = false; bool is_task_posted_ = false;

@@ -82,7 +82,7 @@ class PasswordManagerPorter : public ui::SelectFileDialog::Listener {
std::unique_ptr<password_manager::PasswordManagerExporter> exporter_; std::unique_ptr<password_manager::PasswordManagerExporter> exporter_;
scoped_refptr<ui::SelectFileDialog> select_file_dialog_; scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
Profile* profile_; raw_ptr<Profile> profile_;
// We store |presenter_| and // We store |presenter_| and
// |on_export_progress_callback_| to use them to create a new // |on_export_progress_callback_| to use them to create a new

@@ -8,6 +8,7 @@
#include <string> #include <string>
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/crypto_module_password_dialog.h" #include "chrome/browser/ui/crypto_module_password_dialog.h"
#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/controls/textfield/textfield_controller.h"
@@ -53,9 +54,9 @@ class CryptoModulePasswordDialogView : public views::DialogDelegateView,
const std::string& slot_name, const std::string& slot_name,
CryptoModulePasswordReason reason); CryptoModulePasswordReason reason);
views::Label* reason_label_; raw_ptr<views::Label> reason_label_;
views::Label* password_label_; raw_ptr<views::Label> password_label_;
views::Textfield* password_entry_; raw_ptr<views::Textfield> password_entry_;
CryptoModulePasswordCallback callback_; CryptoModulePasswordCallback callback_;
}; };

@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ #define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/window/dialog_delegate.h" #include "ui/views/window/dialog_delegate.h"
@@ -43,8 +44,8 @@ class FirstRunDialog : public views::DialogDelegateView {
// instead, in which we default to disabling metrics reporting. // instead, in which we default to disabling metrics reporting.
bool closed_through_accept_button_ = false; bool closed_through_accept_button_ = false;
views::Checkbox* make_default_ = nullptr; raw_ptr<views::Checkbox> make_default_ = nullptr;
views::Checkbox* report_crashes_ = nullptr; raw_ptr<views::Checkbox> report_crashes_ = nullptr;
base::RepeatingClosure quit_runloop_; base::RepeatingClosure quit_runloop_;
}; };

@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_LINUX_H_ #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_LINUX_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_LINUX_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_DESKTOP_WINDOW_TREE_HOST_LINUX_H_
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h" #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h"
#include "ui/views/linux_ui/device_scale_factor_observer.h" #include "ui/views/linux_ui/device_scale_factor_observer.h"
@@ -88,9 +89,9 @@ class BrowserDesktopWindowTreeHostLinux
// views::OnDeviceScaleFactorChanged: // views::OnDeviceScaleFactorChanged:
void OnDeviceScaleFactorChanged() override; void OnDeviceScaleFactorChanged() override;
BrowserView* browser_view_ = nullptr; raw_ptr<BrowserView> browser_view_ = nullptr;
BrowserFrame* browser_frame_ = nullptr; raw_ptr<BrowserFrame> browser_frame_ = nullptr;
DesktopBrowserFrameAuraLinux* native_frame_ = nullptr; raw_ptr<DesktopBrowserFrameAuraLinux> native_frame_ = nullptr;
#if defined(USE_DBUS_MENU) #if defined(USE_DBUS_MENU)
// Each browser frame maintains its own menu bar object because the lower // Each browser frame maintains its own menu bar object because the lower

@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_ #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux.h" #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux.h"
#include "ui/views/linux_ui/nav_button_provider.h" #include "ui/views/linux_ui/nav_button_provider.h"
#include "ui/views/linux_ui/window_frame_provider.h" #include "ui/views/linux_ui/window_frame_provider.h"
@@ -42,8 +43,8 @@ class BrowserFrameViewLayoutLinuxNative : public BrowserFrameViewLayoutLinux {
views::FrameButton button_id) const; views::FrameButton button_id) const;
// Owned by BrowserFrameViewLinuxNative. // Owned by BrowserFrameViewLinuxNative.
views::NavButtonProvider* const nav_button_provider_; const raw_ptr<views::NavButtonProvider> nav_button_provider_;
views::WindowFrameProvider* const window_frame_provider_; const raw_ptr<views::WindowFrameProvider> window_frame_provider_;
}; };
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_ #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LAYOUT_LINUX_NATIVE_H_

@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.h" #include "chrome/browser/ui/views/frame/browser_frame_view_layout_linux_native.h"
#include "base/memory/raw_ptr.h"
#include <memory> #include <memory>
@@ -207,17 +208,17 @@ class BrowserFrameViewLayoutLinuxNativeTest : public ChromeViewsTestBase {
} }
std::unique_ptr<views::Widget> widget_; std::unique_ptr<views::Widget> widget_;
views::View* root_view_ = nullptr; raw_ptr<views::View> root_view_ = nullptr;
BrowserFrameViewLayoutLinuxNative* layout_manager_ = nullptr; raw_ptr<BrowserFrameViewLayoutLinuxNative> layout_manager_ = nullptr;
std::unique_ptr<TestLayoutDelegate> delegate_; std::unique_ptr<TestLayoutDelegate> delegate_;
std::unique_ptr<views::NavButtonProvider> nav_button_provider_; std::unique_ptr<views::NavButtonProvider> nav_button_provider_;
std::unique_ptr<views::WindowFrameProvider> frame_provider_; std::unique_ptr<views::WindowFrameProvider> frame_provider_;
// Widgets: // Widgets:
views::ImageButton* minimize_button_ = nullptr; raw_ptr<views::ImageButton> minimize_button_ = nullptr;
views::ImageButton* maximize_button_ = nullptr; raw_ptr<views::ImageButton> maximize_button_ = nullptr;
views::ImageButton* restore_button_ = nullptr; raw_ptr<views::ImageButton> restore_button_ = nullptr;
views::ImageButton* close_button_ = nullptr; raw_ptr<views::ImageButton> close_button_ = nullptr;
}; };
// Tests layout of native navigation buttons. // Tests layout of native navigation buttons.

@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_ #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_VIEW_LINUX_NATIVE_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/views/frame/browser_frame_view_linux.h" #include "chrome/browser/ui/views/frame/browser_frame_view_linux.h"
#include "ui/views/linux_ui/nav_button_provider.h" #include "ui/views/linux_ui/nav_button_provider.h"
#include "ui/views/linux_ui/window_frame_provider.h" #include "ui/views/linux_ui/window_frame_provider.h"
@@ -57,7 +58,7 @@ class BrowserFrameViewLinuxNative : public BrowserFrameViewLinux {
std::unique_ptr<views::NavButtonProvider> nav_button_provider_; std::unique_ptr<views::NavButtonProvider> nav_button_provider_;
views::WindowFrameProvider* const window_frame_provider_; const raw_ptr<views::WindowFrameProvider> window_frame_provider_;
DrawFrameButtonParams cache_{0, false, false}; DrawFrameButtonParams cache_{0, false, false};
}; };

@@ -9,6 +9,7 @@
#include <string> #include <string>
#include "base/containers/flat_set.h" #include "base/containers/flat_set.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h" #include "base/scoped_observation.h"
#include "chrome/browser/command_observer.h" #include "chrome/browser/command_observer.h"
@@ -139,9 +140,9 @@ class DbusAppmenu : public AvatarMenuObserver,
ui::Accelerator* accelerator) const override; ui::Accelerator* accelerator) const override;
// State for the browser window we're tracking. // State for the browser window we're tracking.
Browser* const browser_; const raw_ptr<Browser> browser_;
Profile* profile_; raw_ptr<Profile> profile_;
BrowserView* browser_view_; raw_ptr<BrowserView> browser_view_;
// XID of the browser's frame window that owns this menu. Deliberately stored // XID of the browser's frame window that owns this menu. Deliberately stored
// as plain int (and not as x11::Window) because it is never used for any // as plain int (and not as x11::Window) because it is never used for any
// calls to the X server, but it is always used for building string paths and // calls to the X server, but it is always used for building string paths and
@@ -163,15 +164,15 @@ class DbusAppmenu : public AvatarMenuObserver,
std::vector<std::unique_ptr<ui::SimpleMenuModel>> toplevel_menus_; std::vector<std::unique_ptr<ui::SimpleMenuModel>> toplevel_menus_;
std::vector<std::unique_ptr<ui::SimpleMenuModel>> std::vector<std::unique_ptr<ui::SimpleMenuModel>>
recently_closed_window_menus_; recently_closed_window_menus_;
ui::SimpleMenuModel* history_menu_ = nullptr; raw_ptr<ui::SimpleMenuModel> history_menu_ = nullptr;
ui::SimpleMenuModel* profiles_menu_ = nullptr; raw_ptr<ui::SimpleMenuModel> profiles_menu_ = nullptr;
// Tracks value of the kShowBookmarkBar preference. // Tracks value of the kShowBookmarkBar preference.
PrefChangeRegistrar pref_change_registrar_; PrefChangeRegistrar pref_change_registrar_;
scoped_refptr<history::TopSites> top_sites_; scoped_refptr<history::TopSites> top_sites_;
sessions::TabRestoreService* tab_restore_service_; // weak raw_ptr<sessions::TabRestoreService> tab_restore_service_; // weak
std::unique_ptr<AvatarMenu> avatar_menu_; std::unique_ptr<AvatarMenu> avatar_menu_;

@@ -8,6 +8,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
@@ -71,7 +72,7 @@ class DbusAppmenuRegistrar {
void OnNameOwnerChanged(const std::string& service_owner); void OnNameOwnerChanged(const std::string& service_owner);
scoped_refptr<dbus::Bus> bus_; scoped_refptr<dbus::Bus> bus_;
dbus::ObjectProxy* registrar_proxy_; raw_ptr<dbus::ObjectProxy> registrar_proxy_;
bool service_has_owner_ = false; bool service_has_owner_ = false;
// Maps menus to flags that indicate if the menu has been successfully // Maps menus to flags that indicate if the menu has been successfully

@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_ #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_
#include "base/memory/raw_ptr.h"
#include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
@@ -43,7 +44,7 @@ class DesktopBrowserFrameAuraLinux : public DesktopBrowserFrameAura {
// Whether the custom Chrome frame preference is set. // Whether the custom Chrome frame preference is set.
BooleanPrefMember use_custom_frame_pref_; BooleanPrefMember use_custom_frame_pref_;
BrowserDesktopWindowTreeHostLinux* host_ = nullptr; raw_ptr<BrowserDesktopWindowTreeHostLinux> host_ = nullptr;
}; };
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_ #endif // CHROME_BROWSER_UI_VIEWS_FRAME_DESKTOP_BROWSER_FRAME_AURA_LINUX_H_

@@ -7,6 +7,7 @@
#include <utility> #include <utility>
#include "base/memory/raw_ptr.h"
#include "ui/base/models/image_model.h" #include "ui/base/models/image_model.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
@@ -53,8 +54,8 @@ class ConcatMenuModel : public ui::MenuModel {
// adjusted for the returned menu. // adjusted for the returned menu.
ui::MenuModel* GetMenuAndIndex(int* index) const; ui::MenuModel* GetMenuAndIndex(int* index) const;
ui::MenuModel* const m1_; const raw_ptr<ui::MenuModel> m1_;
ui::MenuModel* const m2_; const raw_ptr<ui::MenuModel> m2_;
}; };
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_CONCAT_MENU_MODEL_H_ #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_CONCAT_MENU_MODEL_H_

@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include "base/memory/raw_ptr.h"
#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/context_menu_controller.h" #include "ui/views/context_menu_controller.h"
#include "ui/views/controls/button/button.h" #include "ui/views/controls/button/button.h"
@@ -49,7 +50,7 @@ class StatusIconButtonLinux : public views::StatusIconLinux,
private: private:
std::unique_ptr<views::Widget> widget_; std::unique_ptr<views::Widget> widget_;
aura::WindowTreeHost* host_ = nullptr; raw_ptr<aura::WindowTreeHost> host_ = nullptr;
std::unique_ptr<views::MenuRunner> menu_runner_; std::unique_ptr<views::MenuRunner> menu_runner_;
}; };

@@ -9,6 +9,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
@@ -103,8 +104,8 @@ class StatusIconLinuxDbus : public views::StatusIconLinux,
scoped_refptr<dbus::Bus> bus_; scoped_refptr<dbus::Bus> bus_;
int service_id_ = 0; int service_id_ = 0;
dbus::ObjectProxy* watcher_ = nullptr; raw_ptr<dbus::ObjectProxy> watcher_ = nullptr;
dbus::ExportedObject* item_ = nullptr; raw_ptr<dbus::ExportedObject> item_ = nullptr;
base::RepeatingCallback<void(bool)> barrier_; base::RepeatingCallback<void(bool)> barrier_;

@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "chrome/browser/status_icons/desktop_notification_balloon.h" #include "chrome/browser/status_icons/desktop_notification_balloon.h"
#include "chrome/browser/status_icons/status_icon.h" #include "chrome/browser/status_icons/status_icon.h"
@@ -89,12 +90,12 @@ class StatusIconLinuxWrapper : public StatusIcon,
scoped_refptr<StatusIconLinuxDbus> status_icon_dbus_; scoped_refptr<StatusIconLinuxDbus> status_icon_dbus_;
#endif #endif
std::unique_ptr<views::StatusIconLinux> status_icon_linux_; std::unique_ptr<views::StatusIconLinux> status_icon_linux_;
views::StatusIconLinux* status_icon_; raw_ptr<views::StatusIconLinux> status_icon_;
StatusIconType status_icon_type_; StatusIconType status_icon_type_;
gfx::ImageSkia image_; gfx::ImageSkia image_;
std::u16string tool_tip_; std::u16string tool_tip_;
StatusIconMenuModel* menu_model_ = nullptr; raw_ptr<StatusIconMenuModel> menu_model_ = nullptr;
}; };
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_

@@ -247,7 +247,7 @@ class PartialTranslateBubbleView : public LocationBarBubbleDelegateView,
base::OnceClosure on_closing_; base::OnceClosure on_closing_;
content::WebContents* web_contents_; raw_ptr<content::WebContents> web_contents_;
}; };
#endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_PARTIAL_TRANSLATE_BUBBLE_VIEW_H_ #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_PARTIAL_TRANSLATE_BUBBLE_VIEW_H_

@@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/memory/raw_ptr.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/common/net/x509_certificate_model.h" #include "chrome/common/net/x509_certificate_model.h"
#include "content/public/browser/web_ui_message_handler.h" #include "content/public/browser/web_ui_message_handler.h"
@@ -82,8 +83,8 @@ class CertificateViewerDialog : public ui::WebDialogDelegate {
// The title of the certificate viewer dialog, Certificate Viewer: CN. // The title of the certificate viewer dialog, Certificate Viewer: CN.
std::u16string title_; std::u16string title_;
content::WebUI* webui_ = nullptr; raw_ptr<content::WebUI> webui_ = nullptr;
ConstrainedWebDialogDelegate* delegate_ = nullptr; raw_ptr<ConstrainedWebDialogDelegate> delegate_ = nullptr;
}; };
// Dialog handler which handles calls from the JS WebUI code to view certificate // Dialog handler which handles calls from the JS WebUI code to view certificate
@@ -123,9 +124,10 @@ class CertificateViewerDialogHandler : public content::WebUIMessageHandler {
int GetCertificateIndex(int requested_index) const; int GetCertificateIndex(int requested_index) const;
// The dialog. // The dialog.
CertificateViewerDialog* dialog_; raw_ptr<CertificateViewerDialog> dialog_;
const std::vector<x509_certificate_model::X509CertificateModel>* certs_; raw_ptr<const std::vector<x509_certificate_model::X509CertificateModel>>
certs_;
}; };
#endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_ #endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_WEBUI_H_

@@ -17,6 +17,7 @@
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/files/file_util.h" // for FileAccessProvider #include "base/files/file_util.h" // for FileAccessProvider
#include "base/i18n/string_compare.h" #include "base/i18n/string_compare.h"
#include "base/memory/raw_ptr.h"
#include "base/posix/safe_strerror.h" #include "base/posix/safe_strerror.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
@@ -136,7 +137,7 @@ struct CertEquals {
bool operator()(const scoped_refptr<net::X509Certificate> cert) const { bool operator()(const scoped_refptr<net::X509Certificate> cert) const {
return net::x509_util::IsSameCertificate(cert_, cert.get()); return net::x509_util::IsSameCertificate(cert_, cert.get());
} }
CERTCertificate* cert_; raw_ptr<CERTCertificate> cert_;
}; };
// Determine if |data| could be a PFX Protocol Data Unit. // Determine if |data| could be a PFX Protocol Data Unit.

@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/certificates_handler.h" #include "chrome/browser/ui/webui/certificates_handler.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
@@ -41,7 +42,7 @@ class CertificateHandlerTest : public ChromeRenderViewHostTestHarness {
protected: protected:
content::TestWebUI web_ui_; content::TestWebUI web_ui_;
certificate_manager::CertificatesHandler cert_handler_; certificate_manager::CertificatesHandler cert_handler_;
sync_preferences::TestingPrefServiceSyncable* pref_service_ = nullptr; raw_ptr<sync_preferences::TestingPrefServiceSyncable> pref_service_ = nullptr;
}; };
#if BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_CHROMEOS)

@@ -6,6 +6,7 @@
#define CHROME_BROWSER_WEB_APPLICATIONS_COMMANDS_SUB_APP_INSTALL_COMMAND_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_COMMANDS_SUB_APP_INSTALL_COMMAND_H_
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/web_applications/commands/web_app_command.h" #include "chrome/browser/web_applications/commands/web_app_command.h"
#include "chrome/browser/web_applications/web_app_id.h" #include "chrome/browser/web_applications/web_app_id.h"
#include "chrome/browser/web_applications/web_app_install_info.h" #include "chrome/browser/web_applications/web_app_install_info.h"
@@ -62,8 +63,8 @@ class SubAppInstallCommand : public web_app::WebAppCommand {
void AddResultAndRemoveFromPendingInstalls(const web_app::AppId& app_id, void AddResultAndRemoveFromPendingInstalls(const web_app::AppId& app_id,
webapps::InstallResultCode result); webapps::InstallResultCode result);
web_app::WebAppInstallManager* install_manager_; raw_ptr<web_app::WebAppInstallManager> install_manager_;
web_app::WebAppRegistrar* registrar_; raw_ptr<web_app::WebAppRegistrar> registrar_;
std::vector<std::pair<web_app::UnhashedAppId, GURL>> requested_installs_; std::vector<std::pair<web_app::UnhashedAppId, GURL>> requested_installs_;
std::set<web_app::UnhashedAppId> pending_installs_; std::set<web_app::UnhashedAppId> pending_installs_;
size_t num_pending_dialog_callbacks_ = 0; size_t num_pending_dialog_callbacks_ = 0;

@@ -8,6 +8,7 @@
#include <list> #include <list>
#include <string> #include <string>
#include "base/memory/raw_ptr.h"
#include "chrome/test/chromedriver/chrome/devtools_event_listener.h" #include "chrome/test/chromedriver/chrome/devtools_event_listener.h"
namespace base { namespace base {
@@ -36,7 +37,7 @@ class PageTracker : public DevToolsEventListener {
const base::DictionaryValue& params) override; const base::DictionaryValue& params) override;
private: private:
std::list<std::unique_ptr<WebViewImpl>>* web_views_; raw_ptr<std::list<std::unique_ptr<WebViewImpl>>> web_views_;
}; };
#endif // CHROME_TEST_CHROMEDRIVER_CHROME_PAGE_TRACKER_H_ #endif // CHROME_TEST_CHROMEDRIVER_CHROME_PAGE_TRACKER_H_

@@ -13,6 +13,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/test/chromedriver/chrome/browser_info.h" #include "chrome/test/chromedriver/chrome/browser_info.h"
@@ -292,7 +293,7 @@ class SyncWebSocketWrapper : public SyncWebSocket {
bool HasNextMessage() override { return socket_->HasNextMessage(); } bool HasNextMessage() override { return socket_->HasNextMessage(); }
private: private:
SyncWebSocket* socket_; raw_ptr<SyncWebSocket> socket_;
}; };
} // namespace } // namespace

@@ -9,6 +9,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/memory/raw_ptr.h"
struct FirefoxRawPasswordInfo; struct FirefoxRawPasswordInfo;
namespace importer { namespace importer {
@@ -59,7 +61,7 @@ class NSSDecryptor {
PK11SlotInfo* slot, SECItem* data, SECItem* result, void* cx) const; PK11SlotInfo* slot, SECItem* data, SECItem* result, void* cx) const;
bool is_nss_initialized_; bool is_nss_initialized_;
PK11SlotInfo* db_slot_; raw_ptr<PK11SlotInfo> db_slot_;
}; };
#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_ #endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_

@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include "base/dcheck_is_on.h" #include "base/dcheck_is_on.h"
#include "base/memory/raw_ptr.h"
#include "base/power_monitor/power_observer.h" #include "base/power_monitor/power_observer.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "base/time/time.h" #include "base/time/time.h"
@@ -98,11 +99,11 @@ class FeatureUsageMetrics final : public base::PowerSuspendObserver {
base::Time Now() const; base::Time Now() const;
const std::string histogram_name_; const std::string histogram_name_;
const Delegate* const delegate_ GUARDED_BY_CONTEXT(sequence_checker_); const raw_ptr<const Delegate> delegate_ GUARDED_BY_CONTEXT(sequence_checker_);
base::Time last_time_enabled_reported_; base::Time last_time_enabled_reported_;
const base::Clock* const clock_; const raw_ptr<const base::Clock> clock_;
base::Time start_usage_; base::Time start_usage_;
base::OneShotTimer timer_; base::OneShotTimer timer_;

@@ -7,6 +7,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/callback_list.h" #include "base/callback_list.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "components/autofill_assistant/browser/client_status.h" #include "components/autofill_assistant/browser/client_status.h"
#include "components/autofill_assistant/browser/devtools/devtools_client.h" #include "components/autofill_assistant/browser/devtools/devtools_client.h"
@@ -74,7 +75,7 @@ class JsFlowDevtoolsWrapper {
// True after FinishInit was called. // True after FinishInit was called.
bool InitDone(); bool InitDone();
content::BrowserContext* browser_context_; raw_ptr<content::BrowserContext> browser_context_;
std::string js_flow_library_; std::string js_flow_library_;
// Only set for the browser context constructor. Lazily instantiated. // Only set for the browser context constructor. Lazily instantiated.

@@ -120,10 +120,10 @@ class JsFlowExecutorImpl : public JsFlowExecutor {
} }
const raw_ptr<Delegate> delegate_; const raw_ptr<Delegate> delegate_;
JsFlowDevtoolsWrapper* js_flow_devtools_wrapper_; raw_ptr<JsFlowDevtoolsWrapper> js_flow_devtools_wrapper_;
// Only set during a flow. // Only set during a flow.
DevtoolsClient* devtools_client_; raw_ptr<DevtoolsClient> devtools_client_;
int isolated_world_context_id_ = -1; int isolated_world_context_id_ = -1;
std::unique_ptr<std::string> js_flow_; std::unique_ptr<std::string> js_flow_;
base::OnceCallback<void(const ClientStatus&, std::unique_ptr<base::Value>)> base::OnceCallback<void(const ClientStatus&, std::unique_ptr<base::Value>)>

@@ -56,6 +56,7 @@ static_library("app") {
sources += [ sources += [
"breakpad_linux.cc", "breakpad_linux.cc",
"breakpad_linux.h", "breakpad_linux.h",
"breakpad_linux_impl.cc",
"breakpad_linux_impl.h", "breakpad_linux_impl.h",
"crashpad_linux.cc", "crashpad_linux.cc",
] ]

@@ -706,7 +706,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
DCHECK(!(upload && minidump.IsFD())); DCHECK(!(upload && minidump.IsFD()));
BreakpadInfo info = {0}; BreakpadInfo info;
info.filename = minidump.path(); info.filename = minidump.path();
info.fd = minidump.fd(); info.fd = minidump.fd();
#if defined(ADDRESS_SANITIZER) #if defined(ADDRESS_SANITIZER)

@@ -0,0 +1,11 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/crash/core/app/breakpad_linux_impl.h"
namespace breakpad {
BreakpadInfo::BreakpadInfo() {}
} // namespace breakpad

@@ -12,6 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <sys/types.h> #include <sys/types.h>
#include "base/memory/raw_ptr.h"
#include "components/crash/core/app/breakpad_linux.h" #include "components/crash/core/app/breakpad_linux.h"
#include "components/crash/core/common/crash_key_internal.h" #include "components/crash/core/common/crash_key_internal.h"
@@ -38,7 +39,9 @@ const size_t kCrashIovSize = 7;
// The minidump information can either be contained in a file descriptor (fd) or // The minidump information can either be contained in a file descriptor (fd) or
// in a file (whose path is in filename). // in a file (whose path is in filename).
struct BreakpadInfo { struct BreakpadInfo {
int fd; // File descriptor to the Breakpad dump data. BreakpadInfo();
int fd = 0; // File descriptor to the Breakpad dump data.
const char* filename; // Path to the Breakpad dump data. const char* filename; // Path to the Breakpad dump data.
#if defined(ADDRESS_SANITIZER) #if defined(ADDRESS_SANITIZER)
const char* log_filename; // Path to the ASan log file. const char* log_filename; // Path to the ASan log file.
@@ -53,7 +56,7 @@ struct BreakpadInfo {
uint64_t process_start_time; // Uptime of the crashing process. uint64_t process_start_time; // Uptime of the crashing process.
size_t oom_size; // Amount of memory requested if OOM. size_t oom_size; // Amount of memory requested if OOM.
uint64_t pid; // PID where applicable. uint64_t pid; // PID where applicable.
crash_reporter::internal::TransitionalCrashKeyStorage* crash_keys; raw_ptr<crash_reporter::internal::TransitionalCrashKeyStorage> crash_keys;
}; };
extern void HandleCrashDump(const BreakpadInfo& info); extern void HandleCrashDump(const BreakpadInfo& info);

@@ -13,6 +13,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "components/dbus/menu/menu_property_list.h" #include "components/dbus/menu/menu_property_list.h"
#include "components/dbus/properties/types.h" #include "components/dbus/properties/types.h"
@@ -74,10 +75,10 @@ class COMPONENT_EXPORT(DBUS) DbusMenu {
// The MenuModel corresponding to this MenuItem, or null if this MenuItem is // The MenuModel corresponding to this MenuItem, or null if this MenuItem is
// not a submenu. This can happen for leaf items or an empty root item. // not a submenu. This can happen for leaf items or an empty root item.
ui::MenuModel* const menu; const raw_ptr<ui::MenuModel> menu;
// |containing_menu| will be null for the root item. If it's null, then // |containing_menu| will be null for the root item. If it's null, then
// |containing_menu_index| is meaningless. // |containing_menu_index| is meaningless.
ui::MenuModel* const containing_menu; const raw_ptr<ui::MenuModel> containing_menu;
const int containing_menu_index; const int containing_menu_index;
}; };
@@ -95,7 +96,7 @@ class COMPONENT_EXPORT(DBUS) DbusMenu {
dbus::MessageReader& reader() { return reader_; } dbus::MessageReader& reader() { return reader_; }
private: private:
dbus::MethodCall* method_call_; raw_ptr<dbus::MethodCall> method_call_;
dbus::ExportedObject::ResponseSender response_sender_; dbus::ExportedObject::ResponseSender response_sender_;
// |reader_| is always needed for all methods on this interface, so it's not // |reader_| is always needed for all methods on this interface, so it's not
@@ -153,7 +154,7 @@ class COMPONENT_EXPORT(DBUS) DbusMenu {
void SendLayoutChangedSignal(int32_t id); void SendLayoutChangedSignal(int32_t id);
dbus::ExportedObject* menu_ = nullptr; raw_ptr<dbus::ExportedObject> menu_ = nullptr;
base::RepeatingCallback<void(bool)> barrier_; base::RepeatingCallback<void(bool)> barrier_;

@@ -7,6 +7,7 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "components/dbus/properties/types.h" #include "components/dbus/properties/types.h"
#include "dbus/bus.h" #include "dbus/bus.h"
@@ -71,7 +72,7 @@ class COMPONENT_EXPORT(DBUS) DbusProperties {
bool initialized_ = false; bool initialized_ = false;
dbus::ExportedObject* exported_object_ = nullptr; raw_ptr<dbus::ExportedObject> exported_object_ = nullptr;
base::RepeatingCallback<void(bool)> barrier_; base::RepeatingCallback<void(bool)> barrier_;

@@ -14,6 +14,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/run_loop.h" #include "base/run_loop.h"
@@ -300,7 +301,7 @@ class ContentExtractionRequest : public ViewRequestDelegate {
FROM_HERE, std::move(finished_callback_)); FROM_HERE, std::move(finished_callback_));
} }
const DistilledArticleProto* article_proto_; raw_ptr<const DistilledArticleProto> article_proto_;
std::unique_ptr<ViewerHandle> viewer_handle_; std::unique_ptr<ViewerHandle> viewer_handle_;
GURL url_; GURL url_;
base::OnceClosure finished_callback_; base::OnceClosure finished_callback_;

@@ -7,6 +7,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_path_override.h" #include "base/test/scoped_path_override.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/nacl/browser/nacl_browser.h" #include "components/nacl/browser/nacl_browser.h"
@@ -44,7 +45,8 @@ class NaClFileHostTest : public testing::Test {
void SetUp() override { void SetUp() override {
nacl_browser_delegate_ = new FileHostTestNaClBrowserDelegate; nacl_browser_delegate_ = new FileHostTestNaClBrowserDelegate;
nacl::NaClBrowser::SetDelegate(base::WrapUnique(nacl_browser_delegate_)); nacl::NaClBrowser::SetDelegate(
base::WrapUnique(nacl_browser_delegate_.get()));
} }
void TearDown() override { void TearDown() override {
@@ -57,7 +59,7 @@ class NaClFileHostTest : public testing::Test {
} }
private: private:
FileHostTestNaClBrowserDelegate* nacl_browser_delegate_; raw_ptr<FileHostTestNaClBrowserDelegate> nacl_browser_delegate_;
}; };
NaClFileHostTest::NaClFileHostTest() : nacl_browser_delegate_(nullptr) {} NaClFileHostTest::NaClFileHostTest() : nacl_browser_delegate_(nullptr) {}

@@ -5,6 +5,7 @@
#ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
#define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include <stddef.h> #include <stddef.h>
@@ -216,7 +217,7 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
// The reply message to send. We must always send this message when the // The reply message to send. We must always send this message when the
// sub-process either succeeds or fails to unblock the renderer waiting for // sub-process either succeeds or fails to unblock the renderer waiting for
// the reply. NULL when there is no reply to send. // the reply. NULL when there is no reply to send.
IPC::Message* reply_msg_; raw_ptr<IPC::Message> reply_msg_;
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
bool debug_exception_handler_requested_; bool debug_exception_handler_requested_;
std::unique_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_; std::unique_ptr<IPC::Message> attach_debug_exception_handler_reply_msg_;

@@ -12,6 +12,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_math.h" #include "base/numerics/safe_math.h"
#include "components/nacl/browser/nacl_browser.h" #include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/pnacl_translation_cache.h" #include "components/nacl/browser/pnacl_translation_cache.h"
@@ -49,7 +50,7 @@ class FileProxy {
private: private:
std::unique_ptr<base::File> file_; std::unique_ptr<base::File> file_;
PnaclHost* host_; raw_ptr<PnaclHost> host_;
}; };
FileProxy::FileProxy(std::unique_ptr<base::File> file, PnaclHost* host) FileProxy::FileProxy(std::unique_ptr<base::File> file, PnaclHost* host)

@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/files/scoped_temp_dir.h" #include "base/files/scoped_temp_dir.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/nacl/browser/pnacl_translation_cache.h" #include "components/nacl/browser/pnacl_translation_cache.h"
@@ -105,7 +106,7 @@ class PnaclHostTest : public testing::Test {
} }
protected: protected:
PnaclHost* host_; raw_ptr<PnaclHost> host_;
int temp_callback_count_; int temp_callback_count_;
int write_callback_count_; int write_callback_count_;
content::BrowserTaskEnvironment task_environment_; content::BrowserTaskEnvironment task_environment_;

@@ -13,6 +13,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "components/nacl/common/pnacl_types.h" #include "components/nacl/common/pnacl_types.h"
@@ -108,7 +109,7 @@ class PnaclTranslationCacheEntry
base::WeakPtr<PnaclTranslationCache> cache_; base::WeakPtr<PnaclTranslationCache> cache_;
std::string key_; std::string key_;
disk_cache::Entry* entry_; raw_ptr<disk_cache::Entry> entry_;
CacheStep step_; CacheStep step_;
bool is_read_; bool is_read_;
GetNexeCallback read_callback_; GetNexeCallback read_callback_;

@@ -15,6 +15,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/platform_shared_memory_region.h" #include "base/memory/platform_shared_memory_region.h"
#include "base/memory/raw_ptr.h"
#include "base/task/task_runner_util.h" #include "base/task/task_runner_util.h"
#include "base/tuple.h" #include "base/tuple.h"
#include "build/build_config.h" #include "build/build_config.h"
@@ -236,7 +237,7 @@ class NaClDescWrapper {
NaClDesc* desc() { return desc_; } NaClDesc* desc() { return desc_; }
private: private:
NaClDesc* desc_; raw_ptr<NaClDesc> desc_;
}; };
std::unique_ptr<NaClDescWrapper> MakeShmRegionNaClDesc( std::unique_ptr<NaClDescWrapper> MakeShmRegionNaClDesc(

@@ -10,6 +10,7 @@
#include <memory> #include <memory>
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
@@ -70,7 +71,7 @@ class NaClIPCAdapterTest : public testing::Test {
// //
// In real life the adapter needs to take ownership so the channel can be // In real life the adapter needs to take ownership so the channel can be
// destroyed on the right thread. // destroyed on the right thread.
IPC::TestSink* sink_; raw_ptr<IPC::TestSink> sink_;
}; };
} // namespace } // namespace

@@ -13,6 +13,7 @@
#include <utility> #include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#if BUILDFLAG(IS_POSIX) #if BUILDFLAG(IS_POSIX)
@@ -150,7 +151,7 @@ class BrowserValidationDBProxy : public NaClValidationDB {
private: private:
// The listener never dies, otherwise this might be a dangling reference. // The listener never dies, otherwise this might be a dangling reference.
NaClListener* listener_; raw_ptr<NaClListener> listener_;
}; };
NaClListener::NaClListener() NaClListener::NaClListener()

@@ -9,6 +9,7 @@
#include <string> #include <string>
#include "base/memory/raw_ptr.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "crypto/hmac.h" #include "crypto/hmac.h"
@@ -25,7 +26,7 @@ class NaClValidationQueryContext {
NaClValidationQuery* CreateQuery(); NaClValidationQuery* CreateQuery();
private: private:
NaClValidationDB* db_; raw_ptr<NaClValidationDB> db_;
// A key used by HMAC that is specific to this installation of Chrome. // A key used by HMAC that is specific to this installation of Chrome.
std::string profile_key_; std::string profile_key_;
@@ -73,7 +74,7 @@ class NaClValidationQuery {
QueryState state_; QueryState state_;
crypto::HMAC hasher_; crypto::HMAC hasher_;
NaClValidationDB* db_; raw_ptr<NaClValidationDB> db_;
// The size of buffer_ is a somewhat arbitrary choice. It needs to be at // The size of buffer_ is a somewhat arbitrary choice. It needs to be at
// at least kDigestLength * 2, but it can be arbitrarily large. In practice // at least kDigestLength * 2, but it can be arbitrarily large. In practice

@@ -4,6 +4,7 @@
#include "components/os_crypt/key_storage_kwallet.h" #include "components/os_crypt/key_storage_kwallet.h"
#include "base/memory/raw_ptr.h"
#include "base/nix/xdg_util.h" #include "base/nix/xdg_util.h"
#include "build/branding_buildflags.h" #include "build/branding_buildflags.h"
#include "dbus/message.h" #include "dbus/message.h"
@@ -122,7 +123,7 @@ class KeyStorageKWalletTest : public testing::Test {
} }
protected: protected:
StrictMock<MockKWalletDBus>* kwallet_dbus_mock_; raw_ptr<StrictMock<MockKWalletDBus>> kwallet_dbus_mock_;
KeyStorageKWallet key_storage_kwallet_; KeyStorageKWallet key_storage_kwallet_;
const std::string wallet_name_ = "mollet"; const std::string wallet_name_ = "mollet";
}; };
@@ -258,7 +259,7 @@ class KeyStorageKWalletFailuresTest
} }
protected: protected:
StrictMock<MockKWalletDBus>* kwallet_dbus_mock_; raw_ptr<StrictMock<MockKWalletDBus>> kwallet_dbus_mock_;
KeyStorageKWallet key_storage_kwallet_; KeyStorageKWallet key_storage_kwallet_;
const std::string wallet_name_ = "mollet"; const std::string wallet_name_ = "mollet";
}; };

@@ -6,6 +6,7 @@
#include <unordered_map> #include <unordered_map>
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
#include "components/os_crypt/key_storage_libsecret.h" #include "components/os_crypt/key_storage_libsecret.h"
#include "components/os_crypt/libsecret_util_linux.h" #include "components/os_crypt/libsecret_util_linux.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
@@ -73,7 +74,7 @@ class MockPasswordStore {
std::unordered_map<GObject*, std::string> mapping_; std::unordered_map<GObject*, std::string> mapping_;
std::vector<GObject*> objects_returned_to_caller_; std::vector<GObject*> objects_returned_to_caller_;
GObject* password_ = nullptr; raw_ptr<GObject> password_ = nullptr;
}; };
base::LazyInstance<MockPasswordStore>::Leaky g_password_store = base::LazyInstance<MockPasswordStore>::Leaky g_password_store =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;

@@ -5,6 +5,7 @@
#include "components/os_crypt/key_storage_linux.h" #include "components/os_crypt/key_storage_linux.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
#include "base/test/test_simple_task_runner.h" #include "base/test/test_simple_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
@@ -30,7 +31,7 @@ class FakeKeyStorageLinux : public KeyStorageLinux {
base::SequencedTaskRunner* GetTaskRunner() override { return task_runner_; } base::SequencedTaskRunner* GetTaskRunner() override { return task_runner_; }
private: private:
base::SequencedTaskRunner* task_runner_; raw_ptr<base::SequencedTaskRunner> task_runner_;
}; };
class KeyStorageLinuxTest : public testing::Test { class KeyStorageLinuxTest : public testing::Test {

@@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/nix/xdg_util.h" #include "base/nix/xdg_util.h"
#include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/optional.h"
@@ -136,7 +137,7 @@ class COMPONENT_EXPORT(OS_CRYPT) KWalletDBus {
// DBus handle for communication with klauncher and kwalletd. // DBus handle for communication with klauncher and kwalletd.
scoped_refptr<dbus::Bus> session_bus_; scoped_refptr<dbus::Bus> session_bus_;
// Object proxy for kwalletd. We do not own this. // Object proxy for kwalletd. We do not own this.
dbus::ObjectProxy* kwallet_proxy_; raw_ptr<dbus::ObjectProxy> kwallet_proxy_;
// KWallet DBus name. // KWallet DBus name.
std::string dbus_service_name_; std::string dbus_service_name_;

@@ -11,6 +11,7 @@
#include <string> #include <string>
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/raw_ptr.h"
// Utility for dynamically loading libsecret. // Utility for dynamically loading libsecret.
class LibsecretLoader { class LibsecretLoader {
@@ -58,7 +59,7 @@ class LibsecretLoader {
private: private:
// |results_| and |error_| are C-style objects owned by this instance. // |results_| and |error_| are C-style objects owned by this instance.
GList* results_ = nullptr; raw_ptr<GList> results_ = nullptr;
GError* error_ = nullptr; GError* error_ = nullptr;
}; };
@@ -124,7 +125,7 @@ class COMPONENT_EXPORT(OS_CRYPT) LibsecretAttributesBuilder {
// to the objects stored in this container. Using a vector here will fail the // to the objects stored in this container. Using a vector here will fail the
// ASan tests, because it may move the objects and break the references. // ASan tests, because it may move the objects and break the references.
std::list<std::string> name_values_; std::list<std::string> name_values_;
GHashTable* attrs_; raw_ptr<GHashTable> attrs_;
}; };
#endif // COMPONENTS_OS_CRYPT_LIBSECRET_UTIL_LINUX_H_ #endif // COMPONENTS_OS_CRYPT_LIBSECRET_UTIL_LINUX_H_

@@ -9,6 +9,7 @@
#include "base/files/file.h" #include "base/files/file.h"
#include "base/files/memory_mapped_file.h" #include "base/files/memory_mapped_file.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkStream.h"
@@ -47,7 +48,7 @@ class MappedFontFile : public base::RefCountedThreadSafe<MappedFontFile> {
uint32_t font_id_; uint32_t font_id_;
base::MemoryMappedFile mapped_font_file_; base::MemoryMappedFile mapped_font_file_;
Observer* observer_; raw_ptr<Observer> observer_;
}; };
} // namespace internal } // namespace internal

@@ -8,6 +8,7 @@
#include <string> #include <string>
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
@@ -135,7 +136,7 @@ class COMPONENT_EXPORT(SYSTEM_MEDIA_CONTROLS) SystemMediaControlsLinux
std::unique_ptr<DbusProperties> properties_; std::unique_ptr<DbusProperties> properties_;
scoped_refptr<dbus::Bus> bus_; scoped_refptr<dbus::Bus> bus_;
dbus::ExportedObject* exported_object_; raw_ptr<dbus::ExportedObject> exported_object_;
// The generated service name given to |bus_| when requesting ownership. // The generated service name given to |bus_| when requesting ownership.
const std::string service_name_; const std::string service_name_;

@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/memory/raw_ptr.h"
#include "components/viz/service/display/overlay_processor_using_strategy.h" #include "components/viz/service/display/overlay_processor_using_strategy.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
#include "ui/ozone/public/hardware_capabilities.h" #include "ui/ozone/public/hardware_capabilities.h"
@@ -59,7 +60,7 @@ class VIZ_SERVICE_EXPORT OverlayProcessorOzone
bool tried_observing_hardware_capabilities_ = false; bool tried_observing_hardware_capabilities_ = false;
std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates_; std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates_;
const std::vector<OverlayStrategy> available_strategies_; const std::vector<OverlayStrategy> available_strategies_;
gpu::SharedImageInterface* const shared_image_interface_; const raw_ptr<gpu::SharedImageInterface> shared_image_interface_;
base::WeakPtrFactory<OverlayProcessorOzone> weak_ptr_factory_{this}; base::WeakPtrFactory<OverlayProcessorOzone> weak_ptr_factory_{this};
}; };

@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include "base/memory/raw_ptr.h"
#include "base/types/pass_key.h" #include "base/types/pass_key.h"
#include "components/viz/service/display_embedder/skia_output_device_offscreen.h" #include "components/viz/service/display_embedder/skia_output_device_offscreen.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
@@ -47,7 +48,7 @@ class SkiaOutputDeviceX11 final : public SkiaOutputDeviceOffscreen {
OutputSurfaceFrame frame) override; OutputSurfaceFrame frame) override;
private: private:
x11::Connection* const connection_; const raw_ptr<x11::Connection> connection_;
const x11::Window window_; const x11::Window window_;
const x11::VisualId visual_; const x11::VisualId visual_;
const x11::GraphicsContext gc_; const x11::GraphicsContext gc_;

@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/memory/raw_ptr.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
@@ -68,7 +69,7 @@ class SoftwareOutputDeviceOzoneTest : public testing::Test {
std::unique_ptr<SoftwareOutputDeviceOzone> output_device_; std::unique_ptr<SoftwareOutputDeviceOzone> output_device_;
bool enable_pixel_output_ = false; bool enable_pixel_output_ = false;
TestSurfaceOzoneCanvas* surface_ozone_ = nullptr; raw_ptr<TestSurfaceOzoneCanvas> surface_ozone_ = nullptr;
}; };
SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() = default; SoftwareOutputDeviceOzoneTest::SoftwareOutputDeviceOzoneTest() = default;

@@ -64,7 +64,7 @@ class CONTENT_EXPORT AccessibilityEventRecorderAuraLinux
void AddATSPIEventListeners(); void AddATSPIEventListeners();
void RemoveATSPIEventListeners(); void RemoveATSPIEventListeners();
AtspiEventListener* atspi_event_listener_ = nullptr; raw_ptr<AtspiEventListener> atspi_event_listener_ = nullptr;
// TODO: should be either removed or converted to a weakptr. // TODO: should be either removed or converted to a weakptr.
const raw_ptr<BrowserAccessibilityManager> manager_; const raw_ptr<BrowserAccessibilityManager> manager_;
base::ProcessId pid_; base::ProcessId pid_;

@@ -5,6 +5,7 @@
#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_AURALINUX_H_ #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_AURALINUX_H_
#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_AURALINUX_H_ #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_AURALINUX_H_
#include "base/memory/raw_ptr.h"
#include "content/browser/accessibility/browser_accessibility.h" #include "content/browser/accessibility/browser_accessibility.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "ui/accessibility/ax_node.h" #include "ui/accessibility/ax_node.h"
@@ -43,7 +44,7 @@ class BrowserAccessibilityAuraLinux : public BrowserAccessibility {
private: private:
// TODO(nektar): Rename to platform_node_ to avoid confusion with ui::AXNode. // TODO(nektar): Rename to platform_node_ to avoid confusion with ui::AXNode.
ui::AXPlatformNodeAuraLinux* node_; raw_ptr<ui::AXPlatformNodeAuraLinux> node_;
}; };
CONTENT_EXPORT BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( CONTENT_EXPORT BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux(

@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "content/browser/accessibility/browser_accessibility_manager.h" #include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
@@ -81,7 +82,7 @@ class CONTENT_EXPORT BrowserAccessibilityManagerAuraLinux
bool CanEmitChildrenChanged(BrowserAccessibility* node) const; bool CanEmitChildrenChanged(BrowserAccessibility* node) const;
void FireEvent(BrowserAccessibility* node, ax::mojom::Event event); void FireEvent(BrowserAccessibility* node, ax::mojom::Event event);
AtkObject* parent_object_; raw_ptr<AtkObject> parent_object_;
// Give BrowserAccessibilityManager::Create access to our constructor. // Give BrowserAccessibilityManager::Create access to our constructor.
friend class BrowserAccessibilityManager; friend class BrowserAccessibilityManager;

@@ -2030,7 +2030,7 @@ class TestPrerenderCancellerSubframeNavigationThrottle
} }
private: private:
NavigationRequest* navigation_request_; raw_ptr<NavigationRequest> navigation_request_;
}; };
// Regression test for https://crbug.com/1323309. // Regression test for https://crbug.com/1323309.

@@ -14,6 +14,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
@@ -247,7 +248,7 @@ class MockInputRouterImplClient : public InputRouterImplClient {
MockInputRouterClient input_router_client_; MockInputRouterClient input_router_client_;
MockWidgetInputHandler widget_input_handler_; MockWidgetInputHandler widget_input_handler_;
MockRenderWidgetHostViewForStylusWriting* render_widget_host_view_; raw_ptr<MockRenderWidgetHostViewForStylusWriting> render_widget_host_view_;
bool on_start_stylus_writing_called_ = false; bool on_start_stylus_writing_called_ = false;
}; };

@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/leak_annotations.h" #include "base/debug/leak_annotations.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/task/sequenced_task_runner.h" #include "base/task/sequenced_task_runner.h"
@@ -90,7 +91,7 @@ class TtsPlatformImplBackgroundWorker {
char* index_mark); char* index_mark);
LibSpeechdLoader libspeechd_loader_; LibSpeechdLoader libspeechd_loader_;
SPDConnection* conn_ = nullptr; raw_ptr<SPDConnection> conn_ = nullptr;
int msg_uid_ = kInvalidMessageUid; int msg_uid_ = kInvalidMessageUid;
// These apply to the current utterance only that is currently being // These apply to the current utterance only that is currently being

@@ -8,6 +8,7 @@
#include <string> #include <string>
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial_params.h" #include "base/metrics/field_trial_params.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/crash/content/browser/error_reporting/javascript_error_report.h" // nogncheck #include "components/crash/content/browser/error_reporting/javascript_error_report.h" // nogncheck
@@ -67,7 +68,7 @@ class FakeJsErrorReportProcessor : public JsErrorReportProcessor {
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
JavaScriptErrorReport last_error_report_; JavaScriptErrorReport last_error_report_;
int error_report_count_ = 0; int error_report_count_ = 0;
BrowserContext* browser_context_ = nullptr; raw_ptr<BrowserContext> browser_context_ = nullptr;
}; };
class MockWebUIController : public WebUIController { class MockWebUIController : public WebUIController {

@@ -10,6 +10,7 @@
#include <string> #include <string>
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "build/chromeos_buildflags.h" #include "build/chromeos_buildflags.h"
#include "crypto/crypto_export.h" #include "crypto/crypto_export.h"
#include "crypto/scoped_nss_types.h" #include "crypto/scoped_nss_types.h"
@@ -51,7 +52,7 @@ class CRYPTO_EXPORT AutoSECMODListReadLock {
~AutoSECMODListReadLock(); ~AutoSECMODListReadLock();
private: private:
SECMODListLock* lock_; raw_ptr<SECMODListLock> lock_;
}; };
#if BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH)

@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/files/file_descriptor_watcher_posix.h" #include "base/files/file_descriptor_watcher_posix.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
@@ -95,7 +96,7 @@ class Watch {
CHECK(dbus_watch_handle(raw_watch_, flags)) << "Unable to allocate memory"; CHECK(dbus_watch_handle(raw_watch_, flags)) << "Unable to allocate memory";
} }
DBusWatch* raw_watch_; raw_ptr<DBusWatch> raw_watch_;
std::unique_ptr<base::FileDescriptorWatcher::Controller> read_watcher_; std::unique_ptr<base::FileDescriptorWatcher::Controller> read_watcher_;
std::unique_ptr<base::FileDescriptorWatcher::Controller> write_watcher_; std::unique_ptr<base::FileDescriptorWatcher::Controller> write_watcher_;
}; };
@@ -141,7 +142,7 @@ class Timeout {
// Calls DBus to handle the timeout. // Calls DBus to handle the timeout.
void HandleTimeout() { CHECK(dbus_timeout_handle(raw_timeout_)); } void HandleTimeout() { CHECK(dbus_timeout_handle(raw_timeout_)); }
DBusTimeout* raw_timeout_; raw_ptr<DBusTimeout> raw_timeout_;
base::WeakPtrFactory<Timeout> weak_ptr_factory_{this}; base::WeakPtrFactory<Timeout> weak_ptr_factory_{this};
}; };

@@ -15,6 +15,7 @@
#include <vector> #include <vector>
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
@@ -728,7 +729,7 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
const ConnectionType connection_type_; const ConnectionType connection_type_;
scoped_refptr<base::SequencedTaskRunner> dbus_task_runner_; scoped_refptr<base::SequencedTaskRunner> dbus_task_runner_;
base::WaitableEvent on_shutdown_; base::WaitableEvent on_shutdown_;
DBusConnection* connection_; raw_ptr<DBusConnection> connection_;
base::PlatformThreadId origin_thread_id_; base::PlatformThreadId origin_thread_id_;
scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; scoped_refptr<base::SequencedTaskRunner> origin_task_runner_;

@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
@@ -257,8 +258,8 @@ class EndToEndAsyncTest : public testing::Test {
std::vector<std::string> error_names_; std::vector<std::string> error_names_;
std::unique_ptr<base::Thread> dbus_thread_; std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_; scoped_refptr<Bus> bus_;
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
ObjectProxy* root_object_proxy_; raw_ptr<ObjectProxy> root_object_proxy_;
std::unique_ptr<TestService> test_service_; std::unique_ptr<TestService> test_service_;
// Text message from "Test" signal. // Text message from "Test" signal.
std::string test_signal_string_; std::string test_signal_string_;

@@ -4,6 +4,7 @@
#include <memory> #include <memory>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
@@ -53,7 +54,7 @@ class EndToEndSyncTest : public testing::Test {
base::test::SingleThreadTaskEnvironment::MainThreadType::IO}; base::test::SingleThreadTaskEnvironment::MainThreadType::IO};
std::unique_ptr<TestService> test_service_; std::unique_ptr<TestService> test_service_;
scoped_refptr<Bus> client_bus_; scoped_refptr<Bus> client_bus_;
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
}; };
TEST_F(EndToEndSyncTest, Echo) { TEST_F(EndToEndSyncTest, Echo) {

@@ -14,6 +14,7 @@
#include <vector> #include <vector>
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/memory/raw_ptr.h"
#include "dbus/dbus_export.h" #include "dbus/dbus_export.h"
#include "dbus/object_path.h" #include "dbus/object_path.h"
@@ -138,7 +139,7 @@ class CHROME_DBUS_EXPORT Message {
std::string ToStringInternal(const std::string& indent, std::string ToStringInternal(const std::string& indent,
MessageReader* reader); MessageReader* reader);
DBusMessage* raw_message_; raw_ptr<DBusMessage> raw_message_;
}; };
// MessageCall is a type of message used for calling a method via D-Bus. // MessageCall is a type of message used for calling a method via D-Bus.
@@ -370,7 +371,7 @@ class CHROME_DBUS_EXPORT MessageWriter {
// Helper function used to implement AppendVariantOfByte() etc. // Helper function used to implement AppendVariantOfByte() etc.
void AppendVariantOfBasic(int dbus_type, const void* value); void AppendVariantOfBasic(int dbus_type, const void* value);
Message* message_; raw_ptr<Message> message_;
DBusMessageIter raw_message_iter_; DBusMessageIter raw_message_iter_;
bool container_is_open_; bool container_is_open_;
}; };
@@ -512,7 +513,7 @@ class CHROME_DBUS_EXPORT MessageReader {
// Helper function used to implement PopVariantOfByte() etc. // Helper function used to implement PopVariantOfByte() etc.
bool PopVariantOfBasic(int dbus_type, void* value); bool PopVariantOfBasic(int dbus_type, void* value);
Message* message_; raw_ptr<Message> message_;
DBusMessageIter raw_message_iter_; DBusMessageIter raw_message_iter_;
}; };

@@ -9,6 +9,7 @@
#include <map> #include <map>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "dbus/object_path.h" #include "dbus/object_path.h"
@@ -327,12 +328,12 @@ class CHROME_DBUS_EXPORT ObjectManager final
// |service_name_owner_|. // |service_name_owner_|.
void UpdateServiceNameOwner(const std::string& new_owner); void UpdateServiceNameOwner(const std::string& new_owner);
Bus* bus_; raw_ptr<Bus> bus_;
std::string service_name_; std::string service_name_;
std::string service_name_owner_; std::string service_name_owner_;
std::string match_rule_; std::string match_rule_;
ObjectPath object_path_; ObjectPath object_path_;
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
bool setup_success_; bool setup_success_;
bool cleanup_called_; bool cleanup_called_;
@@ -348,7 +349,7 @@ class CHROME_DBUS_EXPORT ObjectManager final
Object(); Object();
~Object(); ~Object();
ObjectProxy* object_proxy; raw_ptr<ObjectProxy> object_proxy;
// Maps the name of an interface to the specific PropertySet structure // Maps the name of an interface to the specific PropertySet structure
// of that interface's properties. // of that interface's properties.

@@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h" #include "base/task/single_thread_task_runner.h"
@@ -211,7 +212,7 @@ class ObjectManagerTest
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_; std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_; scoped_refptr<Bus> bus_;
ObjectManager* object_manager_; raw_ptr<ObjectManager> object_manager_;
std::unique_ptr<TestService> test_service_; std::unique_ptr<TestService> test_service_;
std::string last_name_value_; std::string last_name_value_;

@@ -14,6 +14,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "dbus/dbus_export.h" #include "dbus/dbus_export.h"
#include "dbus/message.h" #include "dbus/message.h"
#include "dbus/object_proxy.h" #include "dbus/object_proxy.h"
@@ -191,7 +192,7 @@ class CHROME_DBUS_EXPORT PropertyBase {
private: private:
// Pointer to the PropertySet instance that this instance is a member of, // Pointer to the PropertySet instance that this instance is a member of,
// no ownership is taken and |property_set_| must outlive this class. // no ownership is taken and |property_set_| must outlive this class.
PropertySet* property_set_; raw_ptr<PropertySet> property_set_;
bool is_valid_; bool is_valid_;
@@ -332,7 +333,7 @@ class CHROME_DBUS_EXPORT PropertySet {
// Pointer to object proxy for making method calls, no ownership is taken // Pointer to object proxy for making method calls, no ownership is taken
// so this must outlive this class. // so this must outlive this class.
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
// Interface of property, e.g. "org.chromium.ExampleService", this is // Interface of property, e.g. "org.chromium.ExampleService", this is
// distinct from the interface of the method call itself which is the // distinct from the interface of the method call itself which is the

@@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
@@ -159,7 +160,7 @@ class PropertyTest : public testing::Test {
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_; std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_; scoped_refptr<Bus> bus_;
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
std::unique_ptr<Properties> properties_; std::unique_ptr<Properties> properties_;
std::unique_ptr<TestService> test_service_; std::unique_ptr<TestService> test_service_;
// Properties updated. // Properties updated.

@@ -5,6 +5,7 @@
#include <memory> #include <memory>
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_samples.h" #include "base/metrics/histogram_samples.h"
@@ -163,7 +164,7 @@ class SignalSenderVerificationTest : public testing::Test {
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_; std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_; scoped_refptr<Bus> bus_;
ObjectProxy* object_proxy_; raw_ptr<ObjectProxy> object_proxy_;
std::unique_ptr<TestService> test_service_; std::unique_ptr<TestService> test_service_;
std::unique_ptr<TestService> test_service2_; std::unique_ptr<TestService> test_service2_;
// Text message from "Test" signal. // Text message from "Test" signal.

@@ -6,9 +6,10 @@
#define DBUS_TEST_SERVICE_H_ #define DBUS_TEST_SERVICE_H_
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/threading/thread.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
@@ -223,8 +224,8 @@ class TestService : public base::Thread {
bool has_ownership_; bool has_ownership_;
scoped_refptr<Bus> bus_; scoped_refptr<Bus> bus_;
ExportedObject* exported_object_; raw_ptr<ExportedObject> exported_object_;
ExportedObject* exported_object_manager_; raw_ptr<ExportedObject> exported_object_manager_;
}; };
} // namespace dbus } // namespace dbus

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