Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1633)

Unified Diff: chrome/browser/media/protected_media_identifier_permission_context_factory.cc

Issue 769103002: Refactor ProtectedMediaIdentifierPermissionContext to derive from PermissionContextBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add #ifdef OS_CHROMEOS and clean-up includes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/protected_media_identifier_permission_context_factory.cc
diff --git a/chrome/browser/media/protected_media_identifier_permission_context_factory.cc b/chrome/browser/media/protected_media_identifier_permission_context_factory.cc
index a87baa8250e74ed59e0633c3743918acd77c9523..73e721e854fea57273a13d11dc933e573d260498 100644
--- a/chrome/browser/media/protected_media_identifier_permission_context_factory.cc
+++ b/chrome/browser/media/protected_media_identifier_permission_context_factory.cc
@@ -9,39 +9,14 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#include "components/keyed_service/core/keyed_service.h"
#include "components/pref_registry/pref_registry_syncable.h"
-namespace {
-
-class Service : public KeyedService {
- public:
- explicit Service(Profile* profile) {
- context_ = new ProtectedMediaIdentifierPermissionContext(profile);
- }
-
- ProtectedMediaIdentifierPermissionContext* context() {
- return context_.get();
- }
-
- virtual void Shutdown() override {
- context()->ShutdownOnUIThread();
- }
-
- private:
- scoped_refptr<ProtectedMediaIdentifierPermissionContext> context_;
-
- DISALLOW_COPY_AND_ASSIGN(Service);
-};
-
-} // namespace
-
// static
ProtectedMediaIdentifierPermissionContext*
ProtectedMediaIdentifierPermissionContextFactory::GetForProfile(
Profile* profile) {
- return static_cast<Service*>(
- GetInstance()->GetServiceForBrowserContext(profile, true))->context();
+ return static_cast<ProtectedMediaIdentifierPermissionContext*>(
+ GetInstance()->GetServiceForBrowserContext(profile, true));
}
// static
@@ -65,7 +40,8 @@ ProtectedMediaIdentifierPermissionContextFactory::
KeyedService*
ProtectedMediaIdentifierPermissionContextFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
- return new Service(static_cast<Profile*>(profile));
+ return new ProtectedMediaIdentifierPermissionContext(
+ static_cast<Profile*>(profile));
}
void
« no previous file with comments | « chrome/browser/media/protected_media_identifier_permission_context.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698