Bug 1901043 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

So I ran [Hopper Disassembler](https://www.hopperapp.com/) and took a look at the `CoreGraphics` framework (on an Intel Mac running macOS 13.6.7).

`CGDataProviderCreateTrustedWithCopyOfData()` just calls `CGDataProviderCreateWithCopyOfData()` and sets a flag in the object returned. Within the `CoreGraphics` framework it's only called from `CGBitmapContextCreateImage()`, and then only if `CGContextGetType()` returns `0x4` (`kCGContextTypeBitmap`) or `0xc` (unknown type).

`create_protected_copy()` creates a `CFData` object from raw data, and if it's not greater than `vm_page_size` also calls `vm_protect()` on it with `set_maximum` == `true` and `new_protection` == `1` (read-only).

I still don't really know what "trusted" means here. But it has to do with bitmaps.
So I ran [Hopper Disassembler](https://www.hopperapp.com/) and took a look at the `CoreGraphics` framework (on an Intel Mac running macOS 13.6.7).

`CGDataProviderCreateTrustedWithCopyOfData()` just calls `CGDataProviderCreateWithCopyOfData()` and sets a flag in the object returned. Within the `CoreGraphics` framework it's only called from `CGBitmapContextCreateImage()`, and then only if `CGContextGetType()` returns `0x4` (`kCGContextTypeBitmap`) or `0xc` (unknown type).

`create_protected_copy()` creates a `CFData` object from raw data, and if it's not greater than `vm_page_size` also calls `vm_protect()` on it with `set_maximum` == `true` and `new_protection` == `1` (read-only).

I still don't really know what "trusted" means here. But it has to do with bitmaps.

Edit: Actually, come to think of it, "trusted" probably means "immutable".
So I ran [Hopper Disassembler](https://www.hopperapp.com/) and took a look at the `CoreGraphics` framework (on an Intel Mac running macOS 13.6.7).

`CGDataProviderCreateTrustedWithCopyOfData()` just calls `CGDataProviderCreateWithCopyOfData()` and sets a flag in the object returned. Within the `CoreGraphics` framework it's only called from `CGBitmapContextCreateImage()`, and then only if `CGContextGetType()` returns `0x4` (`kCGContextTypeBitmap`) or `0xc` (unknown type).

`create_protected_copy()` creates a `CFData` object from raw data, and if it's not greater than `vm_page_size` also calls `vm_protect()` on it with `set_maximum` == `true` and `new_protection` == `1` (read-only).

I still don't really know what "trusted" means here. But it has to do with bitmaps. I suppose it could mean "immutable", but `create_protected_copy()` is called from `CGDataProviderCreateWithCopyOfData()`, so *both* providers have immutable data.
So I ran [Hopper Disassembler](https://www.hopperapp.com/) and took a look at the `CoreGraphics` framework (on an Intel Mac running macOS 13.6.7).

`CGDataProviderCreateTrustedWithCopyOfData()` just calls `CGDataProviderCreateWithCopyOfData()` and sets a flag in the object returned. Within the `CoreGraphics` framework it's only called from `CGBitmapContextCreateImage()`, and then only if `CGContextGetType()` returns `0x4` (`kCGContextTypeBitmap`) or `0xc` (unknown type).

`create_protected_copy()` creates a `CFData` object from raw data, and if it's not greater than `vm_page_size` also calls [`vm_protect()`](https://developer.apple.com/documentation/kernel/1585294-vm_protect) on it with `set_maximum` == `true` and `new_protection` == `1` (read-only).

I still don't really know what "trusted" means here. But it has to do with bitmaps. I suppose it could mean "immutable", but `create_protected_copy()` is called from `CGDataProviderCreateWithCopyOfData()`, so *both* providers have immutable data.

Edit: Digging around on https://opensource.apple.com, I found [a reference to the term "trusted UI"](https://opensource.apple.com/source/WebKit2/WebKit2-7610.4.3.1.4/ChangeLog-2020-04-10), which might be relevant here.
So I ran [Hopper Disassembler](https://www.hopperapp.com/) and took a look at the `CoreGraphics` framework (on an Intel Mac running macOS 13.6.7).

`CGDataProviderCreateTrustedWithCopyOfData()` just calls `CGDataProviderCreateWithCopyOfData()` and sets a flag in the object returned. Within the `CoreGraphics` framework it's only called from `CGBitmapContextCreateImage()`, and then only if `CGContextGetType()` returns `0x4` (`kCGContextTypeBitmap`) or `0xc` (unknown type).

`create_protected_copy()` creates a `CFData` object from raw data, and if it's not greater than `vm_page_size` also calls [`vm_protect()`](https://developer.apple.com/documentation/kernel/1585294-vm_protect) on it with `set_maximum` == `true` and `new_protection` == `1` (read-only).

I still don't really know what "trusted" means here. But it has to do with bitmaps. I suppose it could mean "immutable", but `create_protected_copy()` is called from `CGDataProviderCreateWithCopyOfData()`, so *both* providers have immutable data.

Edit: Digging around on https://opensource.apple.com, I found [a reference to the term "trusted UI"](https://opensource.apple.com/source/WebKit2/WebKit2-7610.4.3.1.4/ChangeLog-2020-04-10), which might be relevant here.

See comment #7 below.

Back to Bug 1901043 Comment 4