// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_APP_REGISTRY_CACHE_H_ #define COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_APP_REGISTRY_CACHE_H_ #include <map> #include <utility> #include <vector> #include "base/compiler_specific.h" #include "base/component_export.h" #include "base/containers/contains.h" #include "base/memory/raw_ptr.h" #include "base/observer_list.h" #include "base/observer_list_types.h" #include "base/sequence_checker.h" #include "components/account_id/account_id.h" #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/app_update.h" namespace apps { // An in-memory cache of all the metadata about installed apps known to App // Service. Can be queried synchronously for information about the current // state, and can be observed to receive updates about changes to that app // state. // // AppServiceProxy sees a stream of `apps::AppPtr` "deltas", or changes in app // state, received from publishers. This cache stores the "sum" of those // previous deltas. When a new delta is received, observers are presented with // an `apps:::AppUpdate` containing information about what has changed, and // then the new delta is "added" to the stored state. // // This class is not thread-safe. // // See components/services/app_service/README.md for more details. class COMPONENT_EXPORT(APP_UPDATE) AppRegistryCache { … }; } // namespace apps #endif // COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_APP_REGISTRY_CACHE_H_