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

Issue 2753753007: Introduce Identity Service and its initial usage (Closed)

Created:
3 years, 9 months ago by blundell
Modified:
3 years, 9 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-apps-reviews_chromium.org, chromium-reviews, darin (slow to review), extensions-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce Identity Service and its initial usage This CL introduces the Identity Service and converts the implementation of the chrome.identity.GetProfileUserInfo() extension function to use the new service. Notable points: - The Identity Service is embedded in //chrome rather than //content, as it needs access to per-Profile classes with //chrome-level factories. - The initial API is simply enough to satisfy the needs of the initial consumer. We will build out this API by incrementally converting further consumers. - In the long term, the //components/signin classes on which the Identity Service depends will be folded into the Identity Service implementation, and their consumers will be converted to consume the Identity Service. - The Identity Service makes use of the existing AccountId Mojo struct. It extends that struct to be nullable, as the Identity Service needs to be able to convey to a requesting client that the user is not signed in. Note that a separate HasPrimaryAccount() => bool method would not suffice here: since the communication is asynchronous, the user could always have signed out by the time that the Identity Service receives the GetPrimaryAccountId() call. BUG=683120, 683124 TEST=Install a Chrome extension with the identity and identity.email permissions in its manifest. Go to chrome://extensions, enable developer mode, and inspect the background page of the above app. At the JS console that that brings up, execute: chrome.identity.getProfileUserInfo((account) => {console.log(account)}) Verify that the printout corresponds to the information of the account being used for sync. Review-Url: https://codereview.chromium.org/2753753007 Cr-Commit-Position: refs/heads/master@{#459410} Committed: https://chromium.googlesource.com/chromium/src/+/b85bd3b039159890285ab7df4bf280f89cd9980f

Patch Set 1 #

Patch Set 2 : Make AccountId nullable #

Patch Set 3 : Self-review #

Total comments: 15

Patch Set 4 : Rebase #

Patch Set 5 : Response to reviews #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -10 lines) Patch
M chrome/app/BUILD.gn View 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/DEPS View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_manifest_overlay.json View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/BUILD.gn View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc View 1 2 3 4 2 chunks +29 lines, -9 lines 0 comments Download
M chrome/browser/profiles/DEPS View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 3 chunks +20 lines, -0 lines 0 comments Download
M components/signin/public/interfaces/account_id_traits.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M services/device/device_service.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A services/identity/BUILD.gn View 1 chunk +29 lines, -0 lines 0 comments Download
A services/identity/DEPS View 1 1 chunk +6 lines, -0 lines 0 comments Download
A services/identity/OWNERS View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A services/identity/README.md View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
A services/identity/identity_manager.h View 1 chunk +32 lines, -0 lines 0 comments Download
A services/identity/identity_manager.cc View 1 1 chunk +39 lines, -0 lines 0 comments Download
A services/identity/identity_service.h View 1 chunk +40 lines, -0 lines 0 comments Download
A services/identity/identity_service.cc View 1 1 chunk +32 lines, -0 lines 0 comments Download
A services/identity/manifest.json View 1 chunk +11 lines, -0 lines 0 comments Download
A services/identity/public/interfaces/BUILD.gn View 1 chunk +22 lines, -0 lines 0 comments Download
A services/identity/public/interfaces/OWNERS View 1 chunk +2 lines, -0 lines 0 comments Download
A services/identity/public/interfaces/constants.mojom View 1 chunk +7 lines, -0 lines 0 comments Download
A services/identity/public/interfaces/identity_manager.mojom View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (24 generated)
blundell
rockot@: Whole CL. msarda@: As //services/identity OWNER. I'm working on bringing up a service test ...
3 years, 9 months ago (2017-03-21 10:32:07 UTC) #14
Ken Rockot(use gerrit already)
Very nice, everything LGTM on my end https://codereview.chromium.org/2753753007/diff/40001/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc File chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc (right): https://codereview.chromium.org/2753753007/diff/40001/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc#newcode29 chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc:29: if (!identity_manager_.is_bound()) ...
3 years, 9 months ago (2017-03-21 14:53:09 UTC) #17
blundell
https://codereview.chromium.org/2753753007/diff/40001/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc File chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc (right): https://codereview.chromium.org/2753753007/diff/40001/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc#newcode29 chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc:29: if (!identity_manager_.is_bound()) { On 2017/03/21 14:53:09, Ken Rockot wrote: ...
3 years, 9 months ago (2017-03-21 16:08:47 UTC) #18
msarda
LGTM with nits and some general questions about services in general. https://codereview.chromium.org/2753753007/diff/40001/chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc File chrome/browser/extensions/api/identity/identity_get_profile_user_info_function.cc (right): ...
3 years, 9 months ago (2017-03-23 10:48:57 UTC) #19
blundell
tsepez@: Can you do a security review of the new mojoms and the manifest change? ...
3 years, 9 months ago (2017-03-23 16:38:39 UTC) #21
blundell
thakis@: Can you do an OWNERS review of //chrome? Thanks!
3 years, 9 months ago (2017-03-23 16:39:27 UTC) #23
Tom Sepez
Can you give me some background on account IDs? Are these IDs guessable? How does ...
3 years, 9 months ago (2017-03-23 16:53:18 UTC) #24
msarda
On 2017/03/23 16:53:18, Tom Sepez wrote: > Can you give me some background on account ...
3 years, 9 months ago (2017-03-23 17:12:38 UTC) #25
Nico
chrome/OWNERS lgtm Is there a design doc for The Identity Service, or for services/ in ...
3 years, 9 months ago (2017-03-23 17:40:35 UTC) #26
Tom Sepez
lgtm
3 years, 9 months ago (2017-03-23 18:12:34 UTC) #27
blundell
On 2017/03/23 17:40:35, Nico wrote: > chrome/OWNERS lgtm > > Is there a design doc ...
3 years, 9 months ago (2017-03-24 09:36:43 UTC) #29
blundell
Thanks, everyone! Ken, I'm going to land this and add initial service tests of the ...
3 years, 9 months ago (2017-03-24 09:37:59 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2753753007/80001
3 years, 9 months ago (2017-03-24 09:38:19 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/234895) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 9 months ago (2017-03-24 09:45:38 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2753753007/80001
3 years, 9 months ago (2017-03-24 12:19:56 UTC) #37
commit-bot: I haz the power
3 years, 9 months ago (2017-03-24 13:57:22 UTC) #40
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/b85bd3b039159890285ab7df4bf2...

Powered by Google App Engine
This is Rietveld 408576698