Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Unified Diff: util/mac/checked_mach_address_range.h

Issue 666483002: Create snapshot/mac and move some files from snapshot and util to there (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad/+/master
Patch Set: Move process_reader, process_types, and mach_o_image*_reader from util/mac to snapshot/mac Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/thread_snapshot_mac.cc ('k') | util/mac/checked_mach_address_range.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/checked_mach_address_range.h
diff --git a/util/mac/checked_mach_address_range.h b/util/mac/checked_mach_address_range.h
index ac310c1e8e3676fecc7ca55ce1e8c7ceb234d697..717bb8d915c52378debab671b114f394026a1cee 100644
--- a/util/mac/checked_mach_address_range.h
+++ b/util/mac/checked_mach_address_range.h
@@ -21,14 +21,12 @@
namespace crashpad {
-class ProcessReader;
-
//! \brief Ensures that a range, composed of a base and a size, does not
//! overflow the pointer type of the process it describes a range in.
//!
//! This class checks bases of type `mach_vm_address_t` and sizes of type
-//! `mach_vm_address_t` against a process whose pointer type can be determined
-//! from its ProcessReader.
+//! `mach_vm_address_t` against a process whose pointer type is either 32 or 64
+//! bits wide.
//!
//! Aside from varying the overall range on the basis of a process’ pointer type
//! width, this class functions very similarly to CheckedRange.
@@ -43,19 +41,18 @@ class CheckedMachAddressRange {
//! \brief Initializes a range.
//!
//! See SetRange().
- CheckedMachAddressRange(const ProcessReader* process_reader,
+ CheckedMachAddressRange(bool is_64_bit,
mach_vm_address_t base,
mach_vm_size_t size);
//! \brief Sets a range’s fields.
//!
- //! \param[in] process_reader The ProcessReader that can read the process that
- //! \a base is a pointer to.
+ //! \param[in] is_64_bit `true` if \a base and \a size refer to addresses in a
+ //! 64-bit process; `false` if they refer to addresses in a 32-bit
+ //! process.
//! \param[in] base The range’s base address.
//! \param[in] size The range’s size.
- void SetRange(const ProcessReader* process_reader,
- mach_vm_address_t base,
- mach_vm_size_t size);
+ void SetRange(bool is_64_bit, mach_vm_address_t base, mach_vm_size_t size);
//! \brief The range’s base address.
mach_vm_address_t Base() const;
@@ -100,7 +97,7 @@ class CheckedMachAddressRange {
//! containing address range’s end.
//!
//! This method should only be called on two CheckedMachAddressRange objects
- //! sharing the same ProcessReader.
+ //! representing address ranges in the same process.
//!
//! This method must only be called if IsValid() would return `true` for both
//! CheckedMachAddressRange objects involved.
« no previous file with comments | « snapshot/thread_snapshot_mac.cc ('k') | util/mac/checked_mach_address_range.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698