New issue
Advanced search Search tips

Issue 862200 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Pass MainFunctionParams as a unique_ptr and have its members no longer be raw pointers

Project Member Reported by hanxi@chromium.org, Jul 10

Issue description

Currently the MainFunctionParams (main_function_params.h) are passed as raw pointer but ideally should be unique_ptrs. Therefore, the ownership of its members can be passed with the MainFunctionParams. File this bug to track progress.
 
I would be inclined to use move rather than unique_ptr. I had started doing this, but there is a LOT of code to change.

Comment 2 Deleted

Agreed we should make the struct move-only (by deleting the copy constructor). A few members might need to use unique_ptrs but that shouldn't be all (e
g. Closure is also moveable)
If using move, we potentially need to refactor any newly added member in the MainFunctionParams in the future, while unique_ptr doesn't requires that. Is there any particular reason to use move?
unique_ptr requires assigning on the heap which is unfortunate.
New members can uniquely decide to use unique_ptr of hard to move but at least it's an individual choice.
I see, thanks!
Status: Untriaged (was: Available)
Available, but no owner or component? Please find a component, as no one will ever find this without one.

Sign in to add a comment