Skip to content

Commit

Permalink
Remove unused ExtensionPlatformKeysService instance variables
Browse files Browse the repository at this point in the history
After a series of refactorings done in c/b/c/platform_keys/ specifically
crrev.com/c/2429064, there are some unused leftover variables in
ExtensionPlatformKeysService that are being removed by this CL.

Change-Id: I69211338136dd7efb2856d30d42673ff7d8c29eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2764384
Auto-Submit: Omar Morsi <omorsi@google.com>
Commit-Queue: Omar Morsi <omorsi@google.com>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#863356}
  • Loading branch information
omorsi authored and Chromium LUCI CQ committed Mar 16, 2021
1 parent 87b010e commit 5238fbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/state_store.h"
#include "extensions/common/extension.h"
#include "extensions/common/features/behavior_feature.h"
#include "extensions/common/features/feature.h"
Expand Down Expand Up @@ -763,11 +762,7 @@ ExtensionPlatformKeysService::SelectDelegate::SelectDelegate() {}
ExtensionPlatformKeysService::SelectDelegate::~SelectDelegate() {}

ExtensionPlatformKeysService::ExtensionPlatformKeysService(
bool profile_is_managed,
PrefService* profile_prefs,
policy::PolicyService* profile_policies,
content::BrowserContext* browser_context,
extensions::StateStore* state_store)
content::BrowserContext* browser_context)
: browser_context_(browser_context),
platform_keys_service_(
platform_keys::PlatformKeysServiceFactory::GetForBrowserContext(
Expand All @@ -777,7 +772,6 @@ ExtensionPlatformKeysService::ExtensionPlatformKeysService(
GetForBrowserContext(browser_context)) {
DCHECK(platform_keys_service_);
DCHECK(browser_context);
DCHECK(state_store);
}

ExtensionPlatformKeysService::~ExtensionPlatformKeysService() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,16 @@
#include "chrome/browser/chromeos/platform_keys/platform_keys_service.h"
#include "components/keyed_service/core/keyed_service.h"

class PrefService;

namespace content {
class BrowserContext;
class WebContents;
} // namespace content

namespace extensions {
class StateStore;
}

namespace net {
class X509Certificate;
typedef std::vector<scoped_refptr<X509Certificate>> CertificateList;
} // namespace net

namespace policy {
class PolicyService;
}

namespace chromeos {

class ExtensionPlatformKeysService : public KeyedService {
Expand Down Expand Up @@ -72,17 +62,9 @@ class ExtensionPlatformKeysService : public KeyedService {
DISALLOW_ASSIGN(SelectDelegate);
};

// Stores registration information in |state_store|, i.e. for each extension
// the list of public keys that are valid to be used for signing. See
// |ExtensionKeyPermissionsService| for more details.
// |browser_context| and |state_store| must not be null and outlive this
// object.
// |browser_context| must not be null and must outlive this object.
explicit ExtensionPlatformKeysService(
bool profile_is_managed,
PrefService* profile_prefs,
policy::PolicyService* profile_policies,
content::BrowserContext* browser_context,
extensions::StateStore* state_store);
content::BrowserContext* browser_context);

~ExtensionPlatformKeysService() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
#include "chrome/browser/chromeos/platform_keys/extension_platform_keys_service.h"
#include "chrome/browser/chromeos/platform_keys/key_permissions/key_permissions_service_factory.h"
#include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/platform_keys_certificate_selector_chromeos.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_registry.h"
Expand Down Expand Up @@ -91,7 +88,6 @@ ExtensionPlatformKeysServiceFactory::ExtensionPlatformKeysServiceFactory()
: BrowserContextKeyedServiceFactory(
"ExtensionPlatformKeysService",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
DependsOn(chromeos::platform_keys::PlatformKeysServiceFactory::GetInstance());
DependsOn(
chromeos::platform_keys::KeyPermissionsServiceFactory::GetInstance());
Expand All @@ -107,18 +103,8 @@ ExtensionPlatformKeysServiceFactory::GetBrowserContextToUse(

KeyedService* ExtensionPlatformKeysServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
extensions::StateStore* const store =
extensions::ExtensionSystem::Get(context)->state_store();

policy::ProfilePolicyConnector* const policy_connector =
Profile::FromBrowserContext(context)->GetProfilePolicyConnector();

Profile* const profile = Profile::FromBrowserContext(context);

ExtensionPlatformKeysService* const service =
new ExtensionPlatformKeysService(
policy_connector->IsManaged(), profile->GetPrefs(),
policy_connector->policy_service(), context, store);
new ExtensionPlatformKeysService(context);

service->SetSelectDelegate(std::make_unique<DefaultSelectDelegate>());
return service;
Expand Down

0 comments on commit 5238fbc

Please sign in to comment.