Index: content/browser/permissions/permission_service_impl.h |
diff --git a/content/browser/permissions/permission_service_impl.h b/content/browser/permissions/permission_service_impl.h |
index a6d120cd8be515c6dad0afbab3c6510ee53d2a51..d9286cab2bbbcfdecd6affa241fa5db76669d742 100644 |
--- a/content/browser/permissions/permission_service_impl.h |
+++ b/content/browser/permissions/permission_service_impl.h |
@@ -14,6 +14,7 @@ |
namespace content { |
+class PermissionPendingRequest; |
enum class PermissionType; |
// Implements the PermissionService Mojo interface. |
@@ -26,7 +27,6 @@ enum class PermissionType; |
class PermissionServiceImpl : public PermissionService { |
public: |
~PermissionServiceImpl() override; |
- |
// Clear pending operations currently run by the service. This will be called |
// by PermissionServiceContext when it will need the service to clear its |
// state for example, if the frame changes. |
@@ -40,17 +40,10 @@ class PermissionServiceImpl : public PermissionService { |
private: |
using PermissionStatusCallback = mojo::Callback<void(PermissionStatus)>; |
+ using BatchPermissionStatusCallback = |
+ mojo::Callback<void(mojo::Array<PermissionStatus>)>; |
- struct PendingRequest { |
- PendingRequest(PermissionType permission, const GURL& origin, |
- const PermissionStatusCallback& callback); |
- ~PendingRequest(); |
- |
- PermissionType permission; |
- GURL origin; |
- PermissionStatusCallback callback; |
- }; |
- using RequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; |
+ using RequestsMap = IDMap<PermissionPendingRequest, IDMapOwnPointer>; |
struct PendingSubscription { |
PendingSubscription(PermissionType permission, const GURL& origin, |
@@ -73,6 +66,11 @@ class PermissionServiceImpl : public PermissionService { |
const mojo::String& origin, |
bool user_gesture, |
const PermissionStatusCallback& callback) override; |
+ void RequestBatchPermission( |
+ mojo::Array<PermissionName> permissions, |
+ const mojo::String& origin, |
+ bool user_gesture, |
+ const BatchPermissionStatusCallback& callback) override; |
void RevokePermission(PermissionName permission, |
const mojo::String& origin, |
const PermissionStatusCallback& callback) override; |
@@ -84,7 +82,14 @@ class PermissionServiceImpl : public PermissionService { |
void OnConnectionError(); |
- void OnRequestPermissionResponse(int request_id, PermissionStatus status); |
+ void RequestPermissionInternal( |
+ mojo::Array<PermissionName> permissions, |
+ const mojo::String& origin, |
+ bool user_gesture, |
+ const BatchPermissionStatusCallback& callback); |
+ |
+ void OnRequestPermissionResponse(int request_id, |
+ const std::vector<PermissionStatus>& status); |
PermissionStatus GetPermissionStatusFromName(PermissionName permission, |
const GURL& origin); |