Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 10834102: mac: Let gcapi install chrome as the CGSession owner (Closed)

Created:
8 years, 4 months ago by Nico
Modified:
8 years, 4 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews, grt+watch_chromium.org
Visibility:
Public.

Description

mac: Let gcapi install chrome as the CGSession owner This way, chrome should be able to set up user keystone on first run in most cases. Also don't offer installation if /Applications/Google Chrome.app already exists. BUG=128462 TEST= 1.) Run as user. Have chrome with system ticket and user keystone installed anywhere. -> Shouldn't offer installation. Have chrome with user ticket and user keystone installed anywhere. -> Shouldn't offer installation. Have chrome with system ticket and system keystone installed anywhere. -> Shouldn't offer installation. Have chrome with system ticket and system keystone installed anywhere. -> Shouldn't offer installation. Have chrome in /Applications, no matter owned by whom and no matter if with keystone set up. -> Shouldn't offer installation. Don't have chrome installed -> Offers to install, and creates /Applications/Google Chrome.app which is owned by the current user. On first launch, Chrome registers itself successfully for a user ticket without user interaction. 2.) Same as with 1, but run as root. Should have EXACTLY the same results, i.e. chrome is still installed as current user, and when run as the current user (not root) successfully registers itself. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151324

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : . #

Patch Set 4 : foo #

Total comments: 25

Patch Set 5 : comments1 #

Patch Set 6 : comments2 #

Total comments: 20

Patch Set 7 : . #

Total comments: 6

Patch Set 8 : . #

Total comments: 2

Patch Set 9 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -77 lines) Patch
A + chrome/installer/gcapi_mac/OWNERS View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/installer/gcapi_mac/gcapi.h View 1 2 3 4 5 6 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/installer/gcapi_mac/gcapi.mm View 1 2 3 4 5 6 7 8 11 chunks +135 lines, -72 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Nico
I have a few questions that I have marked with XXX. The interesting questions are: ...
8 years, 4 months ago (2012-08-12 00:23:32 UTC) #1
Mark Mentovai
https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/OWNERS File chrome/installer/gcapi_mac/OWNERS (right): https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/OWNERS#newcode2 chrome/installer/gcapi_mac/OWNERS:2: thakis@chromium.org That’s nice, git seems to think this is ...
8 years, 4 months ago (2012-08-13 13:14:42 UTC) #2
Nico
https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm#newcode112 chrome/installer/gcapi_mac/gcapi.mm:112: // XXX does this need to run as other ...
8 years, 4 months ago (2012-08-13 14:13:33 UTC) #3
Nico
https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm#newcode20 chrome/installer/gcapi_mac/gcapi.mm:20: NSString* const kSystemBrandPath = @"/Library/Google/Google Chrome Brand.plist"; On 2012/08/13 ...
8 years, 4 months ago (2012-08-13 14:52:57 UTC) #4
Mark Mentovai
https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm#newcode112 chrome/installer/gcapi_mac/gcapi.mm:112: // XXX does this need to run as other ...
8 years, 4 months ago (2012-08-13 15:04:34 UTC) #5
Nico
https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/5001/chrome/installer/gcapi_mac/gcapi.mm#newcode74 chrome/installer/gcapi_mac/gcapi.mm:74: CFNumberRef userUID = (CFNumberRef)CFDictionaryGetValue(sessionInfoDict, On 2012/08/13 13:14:42, Mark Mentovai ...
8 years, 4 months ago (2012-08-13 15:42:15 UTC) #6
Mark Mentovai
https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.h File chrome/installer/gcapi_mac/gcapi.h (right): https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.h#newcode10 chrome/installer/gcapi_mac/gcapi.h:10: #define GCCC_ERROR_ACCESSDENIED (1 << 2) You can renumber these ...
8 years, 4 months ago (2012-08-13 15:59:25 UTC) #7
Nico
https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.h File chrome/installer/gcapi_mac/gcapi.h (right): https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.h#newcode10 chrome/installer/gcapi_mac/gcapi.h:10: #define GCCC_ERROR_ACCESSDENIED (1 << 2) On 2012/08/13 15:59:25, Mark ...
8 years, 4 months ago (2012-08-13 18:03:58 UTC) #8
Mark Mentovai
https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/1005/chrome/installer/gcapi_mac/gcapi.mm#newcode222 chrome/installer/gcapi_mac/gcapi.mm:222: // files are created with group of parent dir ...
8 years, 4 months ago (2012-08-13 18:43:24 UTC) #9
Nico
https://chromiumcodereview.appspot.com/10834102/diff/3003/chrome/installer/gcapi_mac/gcapi.mm File chrome/installer/gcapi_mac/gcapi.mm (right): https://chromiumcodereview.appspot.com/10834102/diff/3003/chrome/installer/gcapi_mac/gcapi.mm#newcode70 chrome/installer/gcapi_mac/gcapi.mm:70: //[reinterpret_cast<NSDictionary*>(session_info_dict) autorelease]; On 2012/08/13 18:43:24, Mark Mentovai wrote: > ...
8 years, 4 months ago (2012-08-13 18:54:37 UTC) #10
Mark Mentovai
LGTM with this one last change. I think that’s about as productive as we can ...
8 years, 4 months ago (2012-08-13 18:59:51 UTC) #11
Nico
8 years, 4 months ago (2012-08-13 19:15:06 UTC) #12
Thanks!

https://chromiumcodereview.appspot.com/10834102/diff/5005/chrome/installer/gc...
File chrome/installer/gcapi_mac/gcapi.mm (right):

https://chromiumcodereview.appspot.com/10834102/diff/5005/chrome/installer/gc...
chrome/installer/gcapi_mac/gcapi.mm:71: [(NSDictionary*)session_info_dict
autorelease];
On 2012/08/13 18:59:51, Mark Mentovai wrote:
> This might run under GC. Might not, but also might. We’ve got no control over
> that.
> 
> If it runs in a GC environment, you need to call
> NSMakeCollectable(session_info_dict), otherwise it’s a leak (the autorelease
> won’t do anything).
> 
> See CFTypeRefToNSObjectAutorelease from base/mac/foundation_util.mm.

Done.

Powered by Google App Engine
This is Rietveld 408576698