| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
app_service_manager_registrar_.Reset(*account_id, this);Question: Is there a known case where account_id is empty() in production? Otherwise, add `CHECK(!account_id->empty())`?
}Can we have CHECK_IS_TEST() for `!account_id` case?
ash::AnnotatedAccountId::Set(profile_.get(), kAccountId);optional: `ASSERT_TRUE(app_service_manager_->Find(kAccountId))`?
TestingBrowserProcess::GetGlobal()->local_state());Should this be `g_browser_prcess->local_state()` since this is browser tests?
// (e.g. window bounds, display ID). If `window_info` is nullptr, the appnit: now this part should be "if window_info is not specified"?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTAL.
betty failure looks unrelated.
As chatted offline android_sms service is going to be removed soon, so I applied to another case.
app_service_manager_registrar_.Reset(*account_id, this);Question: Is there a known case where account_id is empty() in production? Otherwise, add `CHECK(!account_id->empty())`?
Done
Can we have CHECK_IS_TEST() for `!account_id` case?
Done
Do we expect this case?
reverted.
ash::AnnotatedAccountId::Set(profile_.get(), kAccountId);Hidehiko Abeoptional: `ASSERT_TRUE(app_service_manager_->Find(kAccountId))`?
reverted.
Should this be `g_browser_prcess->local_state()` since this is browser tests?
Done
// (e.g. window bounds, display ID). If `window_info` is nullptr, the appnit: now this part should be "if window_info is not specified"?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM with a question and an option.
// If there was old registration, unregister the registered app_serviceBTW, do we plan to use this class for other places e.g. unit tests? This seems a bit complicated if it's dedicated to AppServiceProxyAsh's ctor.
class ScopedAppServiceManagerRegistrar {Optional naming proposal:
The current `AppServiceManager` only set/unset/lookup pointers of AppService, so `AppServiceRegistry` might be more intuitive.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
updated according to our offline discussion. PTAL again?
// If there was old registration, unregister the registered app_serviceBTW, do we plan to use this class for other places e.g. unit tests? This seems a bit complicated if it's dedicated to AppServiceProxyAsh's ctor.
Done
Optional naming proposal:
- `AppServiceManager` -> `AppServiceRegistry`
- `ScopedAppServiceManagerRegistrar` -> `ScopedAppServiceRegistration`
The current `AppServiceManager` only set/unset/lookup pointers of AppService, so `AppServiceRegistry` might be more intuitive.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Thank you for applying my suggestions!
LGTM with a final optional nit.
AppService* AppServiceRegistry::Find(const AccountId& account_id) {optional: might be good to have `CHECK(!account_id.empty())` in Find/Register/Unregsiter?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
AppService* AppServiceRegistry::Find(const AccountId& account_id) {optional: might be good to have `CHECK(!account_id.empty())` in Find/Register/Unregsiter?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
9 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: components/services/app_service/public/cpp/app_service_registry.cc
Insertions: 3, Deletions: 0.
@@ -29,17 +29,20 @@
}
AppService* AppServiceRegistry::Find(const AccountId& account_id) {
+ CHECK(!account_id.empty());
auto it = service_map_.find(account_id);
return it == service_map_.end() ? nullptr : it->second;
}
void AppServiceRegistry::Register(const AccountId& account_id,
AppService* app_service) {
+ CHECK(!account_id.empty());
CHECK(app_service);
CHECK(service_map_.try_emplace(account_id, app_service).second);
}
void AppServiceRegistry::Unregister(const AccountId& account_id) {
+ CHECK(!account_id.empty());
CHECK_GT(service_map_.erase(account_id), 0u);
}
```
Introduce AppService interface and AppServiceManager for ChromeOS
AppService interface abstracts AppServiceProxy, living in
components.
AppServiceManager now maintains the AppService instances tied to
the AccountId, so classes in ChromeOS can reduce the code dependencies
to chrome/browser/apps.
BUG=477191550
TEST=Tryjob
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |