Currently the service takes ownership of the raw pointer to the delegate. It should take unique_ptr<> instead to clarify that it takes ownership. The same applies to all the classes that extend OAuth2TokenService.
cc'ing Chrome signin folks, marking as Available.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e commit a9cae0d0eb1e430848ca10bdbfd22cc1f373610e Author: bsazonov <bsazonov@chromium.org> Date: Fri Feb 10 10:46:30 2017 Make OAuth2TokenService and subclasses take delegate by unique_ptr OAuth2TokenService and it's subclasses already take ownership of the delegate passed to the constructor. Using unique_ptr instead of raw pointer makes this behavior obvious for callers and also reduces the chance of leaks. BUG= 688387 Review-Url: https://codereview.chromium.org/2685123002 Cr-Commit-Position: refs/heads/master@{#449584} [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/chromeos/settings/device_oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/chromeos/settings/device_oauth2_token_service.h [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/chromeos/settings/device_oauth2_token_service_factory.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/signin/oauth2_token_service_delegate_android.h [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/chrome/browser/signin/profile_oauth2_token_service_factory.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/components/signin/core/browser/fake_profile_oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/components/signin/core/browser/fake_profile_oauth2_token_service.h [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/components/signin/core/browser/profile_oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/components/signin/core/browser/profile_oauth2_token_service.h [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/extensions/shell/browser/shell_oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/google_apis/gaia/fake_oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/google_apis/gaia/oauth2_token_service.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/google_apis/gaia/oauth2_token_service.h [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/google_apis/gaia/oauth2_token_service_unittest.cc [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm [modify] https://crrev.com/a9cae0d0eb1e430848ca10bdbfd22cc1f373610e/ios/chrome/browser/signin/oauth2_token_service_factory.mm
Comment 1 by ew...@chromium.org
, Feb 8 2017Status: Available (was: Untriaged)