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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_service_factory.h

Issue 2891023002: [cast_channel] Make CastSocket not inherit from ApiResource (Closed)
Patch Set: Created 3 years, 7 months 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: extensions/browser/api/cast_channel/cast_channel_service_factory.h
diff --git a/extensions/browser/api/cast_channel/cast_channel_service_factory.h b/extensions/browser/api/cast_channel/cast_channel_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..5659a186426aecd92e767cf67eca28dda5371540
--- /dev/null
+++ b/extensions/browser/api/cast_channel/cast_channel_service_factory.h
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_
+#define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_
+
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+
+namespace extensions {
+namespace api {
+namespace cast_channel {
+
+class CastChannelService;
+
+class CastChannelServiceFactory : public BrowserContextKeyedServiceFactory {
mark a. foltz 2017/05/18 18:02:27 I think a CastSocket created by one profile (brows
zhaobin 2017/05/24 01:51:40 Created crbug.com/725717
+ public:
+ static CastChannelService* GetForBrowserContext(
+ content::BrowserContext* context);
+
+ static CastChannelServiceFactory* GetInstance();
+
+ private:
+ friend struct base::LazyInstanceTraitsBase<CastChannelServiceFactory>;
+
+ CastChannelServiceFactory();
+ ~CastChannelServiceFactory() override;
+
+ // BrowserContextKeyedServiceFactory interface.
+ content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const override;
+
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(CastChannelServiceFactory);
+};
+
+} // namespace cast_channel
+} // namespace api
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698