New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 665635 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 693215
Owner:
Closed: Feb 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

chrome elf registry functions should have a scoped key helper

Project Member Reported by scottmg@chromium.org, Nov 15 2016

Issue description

In https://codereview.chromium.org/2487783002/diff/40001/chrome/install_static/install_util.ccMark noted that it'd be nicer if the API wasn't so closely matched to the raw NT one. We could have a scoped object be returned to avoid forgetting to close things.
 
The purpose of nt_registry was to access the raw ntdll registry api.  It's not meant to duplicate base (or use it).

If we want to access nt_registry from anywhere other than chrome_elf, I would recommend having a shim/wrapper layer inside of base (that could add scoping usability).  And the static library nt_registry could be a dependency of base.  grt@ was pondering this general idea at some point.

In my opinion, nt_registry should remain raw and as small as possible.  I'm happy to help move this standalone lib under base if we decide that is worth doing!



Sorry, maybe I wasn't clear in the initial report. I'm just using it in chrome_elf, but it still seems a bit cumbersome to require Open/Create to be matched with a corresponding Close, rather than having a ScopedKey helper. Does that seem reasonable? I will prototype what I mean and you can see if you like it.
Oh, did you mean the dependency on base because of using ScopedGeneric? I agree, we wouldn't want to do that. But nt_registry.h could have a simple class with a destructor that does the close.

If just you meant simply that it's "bigger" and less raw with the scoper, I think I disagree. I suspect it'll be less code, and still pretty clear what's happening underneath. But we'd have to try it to be sure, I guess.
Ah ok, feel free to prototype!
Mergedinto: 693215
Status: Duplicate (was: Assigned)

Sign in to add a comment