|
|
Created:
6 years, 3 months ago by grt (UTC plus 2) Modified:
6 years, 3 months ago Reviewers:
gab CC:
chromium-reviews, grt+watch_chromium.org, wfh+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Project:
chromium Visibility:
Public. |
DescriptionSilence logging at uninstall if the ClientState key doesn't exist.
BUG=none
Committed: https://crrev.com/06983b3f5218f38b9de952b47b64ae9ea92f67e7
Cr-Commit-Position: refs/heads/master@{#293829}
Patch Set 1 #
Total comments: 4
Patch Set 2 : logic flip #Messages
Total messages: 15 (4 generated)
grt@chromium.org changed reviewers: + gab@chromium.org
This gets rid of the annoying [0908/082503:ERROR:product.cc(126)] Failed to Open or Write MSI valueto client state key. error: 2 messages in valid uninstall logs.
lgtm w/ nit Question: Why would the ClientState key not exist at uninstall? Is this called after it's deleted? https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... File chrome/installer/util/product.cc (right): https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... chrome/installer/util/product.cc:126: if (result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) nit: I'd prefer handling the error in scope and having the regular (non-scoped) flow be the expected flow, i.e.: ---------------------------------------------------------------------- if (result != ERROR_SUCESS && result != ERROR_FILE_NOT_FOUND) { LOG(ERROR) << ...; return false; } return true; ---------------------------------------------------------------------- makes it such that any other code can be added after handling the error without having to flip the logic.
On 2014/09/08 16:29:58, gab wrote: > Question: Why would the ClientState key not exist at uninstall? Is this called > after it's deleted? In a Google Chrome build, ClientState will still be there. In a Chromium build, Clients and ClientState are both the generic "Software\Chromium" key, which is deleted early on.
https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... File chrome/installer/util/product.cc (right): https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... chrome/installer/util/product.cc:126: if (result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) On 2014/09/08 16:29:58, gab wrote: > nit: I'd prefer handling the error in scope and having the regular (non-scoped) > flow be the expected flow, i.e.: > > ---------------------------------------------------------------------- > if (result != ERROR_SUCESS && result != ERROR_FILE_NOT_FOUND) { > LOG(ERROR) << ...; > return false; > } > > return true; > ---------------------------------------------------------------------- > > makes it such that any other code can be added after handling the error without > having to flip the logic. yeah. my urge to avoid braces made me do it this way. it's prettier. i can't imagine this function having more code after this. how strongly do you feel about this?
https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... File chrome/installer/util/product.cc (right): https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... chrome/installer/util/product.cc:126: if (result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) On 2014/09/08 16:47:56, grt wrote: > On 2014/09/08 16:29:58, gab wrote: > > nit: I'd prefer handling the error in scope and having the regular > (non-scoped) > > flow be the expected flow, i.e.: > > > > ---------------------------------------------------------------------- > > if (result != ERROR_SUCESS && result != ERROR_FILE_NOT_FOUND) { > > LOG(ERROR) << ...; > > return false; > > } > > > > return true; > > ---------------------------------------------------------------------- > > > > makes it such that any other code can be added after handling the error > without > > having to flip the logic. > > yeah. my urge to avoid braces made me do it this way. it's prettier. i can't > imagine this function having more code after this. how strongly do you feel > about this? Mildly. I don't think having to add braces matters, but I do find it weird for the success condition to be in the middle while the end of the method is the error case.
Flipped! https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... File chrome/installer/util/product.cc (right): https://codereview.chromium.org/551783003/diff/1/chrome/installer/util/produc... chrome/installer/util/product.cc:126: if (result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND) On 2014/09/08 16:58:41, gab wrote: > On 2014/09/08 16:47:56, grt wrote: > > On 2014/09/08 16:29:58, gab wrote: > > > nit: I'd prefer handling the error in scope and having the regular > > (non-scoped) > > > flow be the expected flow, i.e.: > > > > > > ---------------------------------------------------------------------- > > > if (result != ERROR_SUCESS && result != ERROR_FILE_NOT_FOUND) { > > > LOG(ERROR) << ...; > > > return false; > > > } > > > > > > return true; > > > ---------------------------------------------------------------------- > > > > > > makes it such that any other code can be added after handling the error > > without > > > having to flip the logic. > > > > yeah. my urge to avoid braces made me do it this way. it's prettier. i can't > > imagine this function having more code after this. how strongly do you feel > > about this? > > Mildly. I don't think having to add braces matters, but I do find it weird for > the success condition to be in the middle while the end of the method is the > error case. Done.
The CQ bit was checked by grt@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grt@chromium.org/551783003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Exceeded time limit waiting for builds to trigger.
The CQ bit was checked by gab@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/grt@chromium.org/551783003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as 0fe0769c6b2cb9013edf776db4eb185b9df7c41a
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/06983b3f5218f38b9de952b47b64ae9ea92f67e7 Cr-Commit-Position: refs/heads/master@{#293829} |