Commit 785cab4b authored by nancylingwang's avatar nancylingwang Committed by Commit Bot

Add the component build for AppRegistryCache.

Convert source_set to component for "app_update", because
AppRegistryCache is used by Ash, which uses component. So modify
"app_update" as component too to avoid the multiple instance issue for
AppRegistryCache in component build.

BUG=1124863

Change-Id: Ic90a78b7314616326051b37bfc77d59e9299e124
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392033Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804637}
parent abc4ec99
...@@ -16,7 +16,8 @@ source_set("app_file_handling") { ...@@ -16,7 +16,8 @@ source_set("app_file_handling") {
] ]
} }
source_set("app_update") { component("app_update") {
output_name = "APP_UPDATE"
sources = [ sources = [
"app_registry_cache.cc", "app_registry_cache.cc",
"app_registry_cache.h", "app_registry_cache.h",
...@@ -26,6 +27,8 @@ source_set("app_update") { ...@@ -26,6 +27,8 @@ source_set("app_update") {
"app_update.h", "app_update.h",
] ]
defines = [ "IS_APP_UPDATE_IMPL" ]
public_deps = [ public_deps = [
"//components/account_id:account_id", "//components/account_id:account_id",
"//components/services/app_service/public/mojom", "//components/services/app_service/public/mojom",
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/observer_list_types.h" #include "base/observer_list_types.h"
...@@ -31,9 +32,9 @@ namespace apps { ...@@ -31,9 +32,9 @@ namespace apps {
// This class is not thread-safe. // This class is not thread-safe.
// //
// See //components/services/app_service/README.md for more details. // See //components/services/app_service/README.md for more details.
class AppRegistryCache { class COMPONENT_EXPORT(APP_UPDATE) AppRegistryCache {
public: public:
class Observer : public base::CheckedObserver { class COMPONENT_EXPORT(APP_UPDATE) Observer : public base::CheckedObserver {
public: public:
// The apps::AppUpdate argument shouldn't be accessed after OnAppUpdate // The apps::AppUpdate argument shouldn't be accessed after OnAppUpdate
// returns. // returns.
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <map> #include <map>
#include "base/component_export.h"
class AccountId; class AccountId;
namespace apps { namespace apps {
...@@ -15,7 +17,7 @@ class AppRegistryCache; ...@@ -15,7 +17,7 @@ class AppRegistryCache;
// Wraps AppRegistryCache to get all AppRegistryCaches independently. Provides // Wraps AppRegistryCache to get all AppRegistryCaches independently. Provides
// the method to get the AppRegistryCache per |account_id|. // the method to get the AppRegistryCache per |account_id|.
class AppRegistryCacheWrapper { class COMPONENT_EXPORT(APP_UPDATE) AppRegistryCacheWrapper {
public: public:
// Returns the global AppRegistryCacheWrapper object. // Returns the global AppRegistryCacheWrapper object.
static AppRegistryCacheWrapper& Get(); static AppRegistryCacheWrapper& Get();
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "components/services/app_service/public/mojom/types.mojom.h" #include "components/services/app_service/public/mojom/types.mojom.h"
...@@ -42,7 +43,7 @@ namespace apps { ...@@ -42,7 +43,7 @@ namespace apps {
// remain valid for the lifetime of the AppUpdate. // remain valid for the lifetime of the AppUpdate.
// //
// See //components/services/app_service/README.md for more details. // See //components/services/app_service/README.md for more details.
class AppUpdate { class COMPONENT_EXPORT(APP_UPDATE) AppUpdate {
public: public:
// Modifies |state| by copying over all of |delta|'s known fields: those // Modifies |state| by copying over all of |delta|'s known fields: those
// fields whose values aren't "unknown". The |state| may not be nullptr. // fields whose values aren't "unknown". The |state| may not be nullptr.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment