|
|
Created:
3 years, 7 months ago by Boris Vidolov Modified:
3 years, 7 months ago CC:
chromium-reviews, mac-reviews_chromium.org, borisv, shrike Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionDetect updater state for Mac (version, health) and attempt to understand
if Chrome was launched by an enterprise user (domain joined).
Review-Url: https://codereview.chromium.org/2862723002
Cr-Commit-Position: refs/heads/master@{#470622}
Committed: https://chromium.googlesource.com/chromium/src/+/a97d530f854c213b4b37b7e363fc341e2c44e773
Patch Set 1 #Patch Set 2 : Removed the temporary comment on ifdefs. #Patch Set 3 : Added check for nil version in the info.plist. More comments. #
Total comments: 9
Patch Set 4 : One type and minor formatting improvements. #Patch Set 5 : Remove the time extraction helper method from the header. #
Total comments: 12
Patch Set 6 : Scoped pointers for NSObject instances; removed a memory leak when reading different type. #
Total comments: 2
Patch Set 7 : Use ScopedCFTypeRef for the plist values to simplify the code. #Patch Set 8 : Merge branch 'master' of https://chromium.googlesource.com/chromium/src into UpdaterStateMac #Patch Set 9 : Merge with master branch brought new name of a method. #Patch Set 10 : Exclude iOS from the updater state logic. #
Messages
Total messages: 59 (32 generated)
The CQ bit was checked by borisv@google.com
The CQ bit was unchecked by borisv@google.com
The CQ bit was checked by borisv@google.com
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer,_not_ a full super star committer. Committers are members of the group "project-chromium-committers". Note that this has nothing to do with OWNERS files.
borisv@google.com changed reviewers: + sorin@chromium.org
Sorin, please take a look at the change. Note that I am dragging a system library dependency (OpenDirectory.framework) and there is some objective-C code. Let me know if this should be reviewed by the Mac colleagues too.
Boris, please ask someone to do a review for the .mm code, for style as well as correctness. Thank you! https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... File components/update_client/updater_state.h (right): https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state.h:50: #if defined(OS_WIN) can we avoid conditional compilation in this file? Can we ignore the is_machine parameter on macOS? https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:6: #import <OpenDirectory/OpenDirectory.h> Usually, an empty line is inserted between 6 and 7. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:17: const base::FilePath::CharType kKeystonePlist[] = FILE_PATH_LITERAL( Namespace formatting: please include an empty line between 16 and 17. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:23: // documentation for tooll-free bridging. toll
Description was changed from ========== Add updater state for Mac. Merge branch 'master' of https://chromium.googlesource.com/chromium/src Minor fixes on the comments: - Removed unnecessary comment in KeystoneGlue's updateProfileCountsWithNumProfiles implementation - Fixed the spelling of Keystone in ChromeBrowserMainPartsMac::PostProfileInit's implementation Ensure that failure to load the profiles does not cause crash. BUG= ========== to ========== Add updater state for Mac. Merge branch 'master' of https://chromium.googlesource.com/chromium/src Minor fixes on the comments: - Removed unnecessary comment in KeystoneGlue's updateProfileCountsWithNumProfiles implementation - Fixed the spelling of Keystone in ChromeBrowserMainPartsMac::PostProfileInit's implementation Ensure that failure to load the profiles does not cause crash. BUG= ==========
sorin@chromium.org changed reviewers: + waffles@chromium.org
borisv@google.com changed reviewers: + shrike@chromium.org
shrike@, please take a look from Mac point of view. Sorin, thank you for the code review. I responded to the conditional compilation suggestion and fixed the formatting/typos. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... File components/update_client/updater_state.h (right): https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state.h:50: #if defined(OS_WIN) On 2017/05/04 19:53:58, Sorin Jianu wrote: > can we avoid conditional compilation in this file? Can we ignore the is_machine > parameter on macOS? We have to user conditional anyway anyway for the wchar_t* and char* difference. I don't believe that Mac knows wchar_t at all. Alternatively, we can drag an additional header to define it as base::FilePath::CharType. Or we can try forward declaration of base::FilePath::CharType and then include that header in updater_state_win.cc. A third option (my preference) is that we pull this method out of the class definition at all. As this is a static method, it can very well be defined locally for the _win and _mac implementation files. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:6: #import <OpenDirectory/OpenDirectory.h> On 2017/05/04 19:53:59, Sorin Jianu wrote: > Usually, an empty line is inserted between 6 and 7. Done. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:17: const base::FilePath::CharType kKeystonePlist[] = FILE_PATH_LITERAL( On 2017/05/04 19:53:59, Sorin Jianu wrote: > Namespace formatting: please include an empty line between 16 and 17. Done. https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state_mac.mm:23: // documentation for tooll-free bridging. On 2017/05/04 19:53:59, Sorin Jianu wrote: > toll Done.
borisv@chromium.org changed reviewers: - borisv@google.com
(cleaning up reviewers)
Thank you Boris! https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... File components/update_client/updater_state.h (right): https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... components/update_client/updater_state.h:50: #if defined(OS_WIN) On 2017/05/04 22:19:27, borisv wrote: > On 2017/05/04 19:53:58, Sorin Jianu wrote: > > can we avoid conditional compilation in this file? Can we ignore the > is_machine > > parameter on macOS? > > We have to user conditional anyway anyway for the wchar_t* and char* > difference. I don't believe that Mac knows wchar_t at all. Alternatively, we can > drag an additional header to define it as base::FilePath::CharType. Or we can > try forward declaration of base::FilePath::CharType and then include that header > in updater_state_win.cc. > > A third option (my preference) is that we pull this method out of the class > definition at all. As this is a static method, it can very well be defined > locally for the _win and _mac implementation files. wchar_t is a standard type. Also, I can change the code to take a char literal, if that is better accommodated, please tell me which one would you prefer.
On 2017/05/04 22:50:49, Sorin Jianu wrote: > Thank you Boris! > > https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... > File components/update_client/updater_state.h (right): > > https://codereview.chromium.org/2862723002/diff/40001/components/update_clien... > components/update_client/updater_state.h:50: #if defined(OS_WIN) > On 2017/05/04 22:19:27, borisv wrote: > > On 2017/05/04 19:53:58, Sorin Jianu wrote: > > > can we avoid conditional compilation in this file? Can we ignore the > > is_machine > > > parameter on macOS? > > > > We have to user conditional anyway anyway for the wchar_t* and char* > > difference. I don't believe that Mac knows wchar_t at all. Alternatively, we > can > > drag an additional header to define it as base::FilePath::CharType. Or we can > > try forward declaration of base::FilePath::CharType and then include that > header > > in updater_state_win.cc. > > > > A third option (my preference) is that we pull this method out of the class > > definition at all. As this is a static method, it can very well be defined > > locally for the _win and _mac implementation files. > > wchar_t is a standard type. > > Also, I can change the code to take a char literal, if that is better > accommodated, please tell me which one would you prefer. I removed the mac-specific declaration and placed it in the _mac.mm implementation file.
Minor updates to avoid conditional compilation in updater_state.h PTAL
rsesek@chromium.org changed reviewers: + rsesek@chromium.org
Some drive-by comments :) https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:27: T* CopyUpdaterSettingsValue(NSString* value_name) { Can this return a base::scoped_nsobject<T> to make ownership explicit, and cleanup free? https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:45: @autoreleasepool { Use base::mac::ScopedNSAutoreleasePool from base/mac/scoped_nsautorelease_pool.h. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:84: base::Version systemKeystone = GetVersionFromPlist(system_bundle_plist); naming: system_keystone https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:118: @autoreleasepool { ScopedNSAutoreleasePool https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:165: NSString *attributeValue = naming: attribute_value https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:165: NSString *attributeValue = nit: * goes next to NSString
borisv@ - rsesek@ is an excellent person to review your code for Mac style (and it looks like he already has taken a look), so I will bow out of reviewing.
Thank you, Robert. I added the suggestions and also removed a possible object leak if the retrieved data is of unexpected type. PTAL https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:27: T* CopyUpdaterSettingsValue(NSString* value_name) { On 2017/05/05 21:53:56, Robert Sesek wrote: > Can this return a base::scoped_nsobject<T> to make ownership explicit, and > cleanup free? Done. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:45: @autoreleasepool { On 2017/05/05 21:53:56, Robert Sesek wrote: > Use base::mac::ScopedNSAutoreleasePool from > base/mac/scoped_nsautorelease_pool.h. Done. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:84: base::Version systemKeystone = GetVersionFromPlist(system_bundle_plist); On 2017/05/05 21:53:55, Robert Sesek wrote: > naming: system_keystone Done. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:118: @autoreleasepool { On 2017/05/05 21:53:56, Robert Sesek wrote: > ScopedNSAutoreleasePool Done. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:165: NSString *attributeValue = On 2017/05/05 21:53:55, Robert Sesek wrote: > nit: * goes next to NSString Done. https://codereview.chromium.org/2862723002/diff/80001/components/update_clien... components/update_client/updater_state_mac.mm:165: NSString *attributeValue = On 2017/05/05 21:53:55, Robert Sesek wrote: > nit: * goes next to NSString Done.
lgtm Thank you Boris! Everything not .mm lgtm
LGTM. Please also edit the CL description to describe the change. https://codereview.chromium.org/2862723002/diff/100001/components/update_clie... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/100001/components/update_clie... components/update_client/updater_state_mac.mm:31: CFPropertyListRef plist = Switch this to a base::ScopedCFTypeRef and then you can remove line 37.
Description was changed from ========== Add updater state for Mac. Merge branch 'master' of https://chromium.googlesource.com/chromium/src Minor fixes on the comments: - Removed unnecessary comment in KeystoneGlue's updateProfileCountsWithNumProfiles implementation - Fixed the spelling of Keystone in ChromeBrowserMainPartsMac::PostProfileInit's implementation Ensure that failure to load the profiles does not cause crash. BUG= ========== to ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). Merge branch 'master' of https://chromium.googlesource.com/chromium/src Minor fixes on the comments: - Removed unnecessary comment in KeystoneGlue's updateProfileCountsWithNumProfiles implementation - Fixed the spelling of Keystone in ChromeBrowserMainPartsMac::PostProfileInit's implementation Ensure that failure to load the profiles does not cause crash. BUG= ==========
borisv@chromium.org changed reviewers: - shrike@chromium.org
Thank you, Robert. I changed the code to use ScopedCFTypeRef object - the whole method is simpler now. https://codereview.chromium.org/2862723002/diff/100001/components/update_clie... File components/update_client/updater_state_mac.mm (right): https://codereview.chromium.org/2862723002/diff/100001/components/update_clie... components/update_client/updater_state_mac.mm:31: CFPropertyListRef plist = On 2017/05/08 17:14:13, Robert Sesek wrote: > Switch this to a base::ScopedCFTypeRef and then you can remove line 37. Thanks, Robert. One more scoped pointer type that I was not aware of :). Good suggestion - I threw away a few more lines of code that dealt with releasing and checking for NULL.
LGTM. Please do clean up the CL description on Rietveld before landing, though.
The CQ bit was checked by borisv@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from sorin@chromium.org, rsesek@chromium.org Link to the patchset: https://codereview.chromium.org/2862723002/#ps160001 (title: "Merge with master branch brought new name of a method.")
Description was changed from ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). Merge branch 'master' of https://chromium.googlesource.com/chromium/src Minor fixes on the comments: - Removed unnecessary comment in KeystoneGlue's updateProfileCountsWithNumProfiles implementation - Fixed the spelling of Keystone in ChromeBrowserMainPartsMac::PostProfileInit's implementation Ensure that failure to load the profiles does not cause crash. BUG= ========== to ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ==========
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ========== to ========== Add updater state for Mac. Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ==========
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by borisv@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
Description was changed from ========== Add updater state for Mac. Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ========== to ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ==========
The CQ bit was checked by borisv@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from sorin@chromium.org, rsesek@chromium.org Link to the patchset: https://codereview.chromium.org/2862723002/#ps180001 (title: "Exclude iOS from the updater state logic.")
Description was changed from ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ========== to ========== Add updater state for Mac. Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ==========
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
The CQ bit was checked by borisv@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, build has not started yet; builder either lacks capacity or does not exist (misspelled?))
The CQ bit was checked by rsesek@chromium.org
The CQ bit was unchecked by rsesek@chromium.org
The CQ bit was checked by borisv@chromium.org
Description was changed from ========== Add updater state for Mac. Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ========== to ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ==========
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 180001, "attempt_start_ts": 1494432693044990, "parent_rev": "011afda700511a9c30c7256cda8d5bc2e4b62fe8", "commit_rev": "a97d530f854c213b4b37b7e363fc341e2c44e773"}
Message was sent while issue was closed.
Description was changed from ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). ========== to ========== Detect updater state for Mac (version, health) and attempt to understand if Chrome was launched by an enterprise user (domain joined). Review-Url: https://codereview.chromium.org/2862723002 Cr-Commit-Position: refs/heads/master@{#470622} Committed: https://chromium.googlesource.com/chromium/src/+/a97d530f854c213b4b37b7e363fc... ==========
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/a97d530f854c213b4b37b7e363fc... |