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

Unified Diff: content/browser/permissions/permission_service_context.h

Issue 2842013002: Use a mojo::StrongBindingSet to manage PermissionServiceImpls (Closed)
Patch Set: Created 3 years, 8 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: content/browser/permissions/permission_service_context.h
diff --git a/content/browser/permissions/permission_service_context.h b/content/browser/permissions/permission_service_context.h
index c2fc55aefe194452ee8c5e44fae10f113912c2b6..122739709a4eeed52d81c1c334621ee4c1bed47a 100644
--- a/content/browser/permissions/permission_service_context.h
+++ b/content/browser/permissions/permission_service_context.h
@@ -8,14 +8,8 @@
#include "base/macros.h"
#include "content/public/browser/permission_type.h"
#include "content/public/browser/web_contents_observer.h"
-#include "mojo/public/cpp/bindings/interface_request.h"
-
-namespace blink {
-namespace mojom {
-class PermissionObserver;
-class PermissionService;
-}
-}
+#include "mojo/public/cpp/bindings/strong_binding_set.h"
+#include "third_party/WebKit/public/platform/modules/permissions/permission.mojom.h"
namespace url {
class Origin;
@@ -23,7 +17,6 @@ class Origin;
namespace content {
-class PermissionServiceImpl;
class RenderFrameHost;
class RenderProcessHost;
@@ -38,17 +31,11 @@ class PermissionServiceContext : public WebContentsObserver {
explicit PermissionServiceContext(RenderProcessHost* render_process_host);
~PermissionServiceContext() override;
- void CreateService(
- mojo::InterfaceRequest<blink::mojom::PermissionService> request);
-
- void CreateSubscription(
- PermissionType permission_type,
- const url::Origin& origin,
- mojo::InterfacePtr<blink::mojom::PermissionObserver> observer);
+ void CreateService(blink::mojom::PermissionServiceRequest request);
- // Called by a PermissionServiceImpl identified as |service| when it has a
- // connection error in order to get unregistered and killed.
- void ServiceHadConnectionError(PermissionServiceImpl* service);
+ void CreateSubscription(PermissionType permission_type,
+ const url::Origin& origin,
+ blink::mojom::PermissionObserverPtr observer);
// Called when the connection to a PermissionObserver has an error.
void ObserverHadConnectionError(int subscription_id);
@@ -71,7 +58,7 @@ class PermissionServiceContext : public WebContentsObserver {
RenderFrameHost* render_frame_host_;
RenderProcessHost* render_process_host_;
- std::vector<std::unique_ptr<PermissionServiceImpl>> services_;
+ mojo::StrongBindingSet<blink::mojom::PermissionService> services_;
std::unordered_map<int, std::unique_ptr<PermissionSubscription>>
subscriptions_;

Powered by Google App Engine
This is Rietveld 408576698