| Index: content/shell/browser/layout_test/layout_test_permission_manager.h
|
| diff --git a/content/shell/browser/layout_test/layout_test_permission_manager.h b/content/shell/browser/layout_test/layout_test_permission_manager.h
|
| index 9c0461f7788d6aa3f6a8a70f9a36408dd6ba40cc..8aa905e23623267b365aaeda0f08d3e7b9b4fd92 100644
|
| --- a/content/shell/browser/layout_test/layout_test_permission_manager.h
|
| +++ b/content/shell/browser/layout_test/layout_test_permission_manager.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/containers/hash_tables.h"
|
| +#include "base/id_map.h"
|
| #include "base/macros.h"
|
| #include "base/synchronization/lock.h"
|
| #include "content/public/browser/permission_manager.h"
|
| @@ -56,10 +57,12 @@ class LayoutTestPermissionManager : public PermissionManager {
|
| private:
|
| // Representation of a permission for the LayoutTestPermissionManager.
|
| struct PermissionDescription {
|
| + PermissionDescription() = default;
|
| PermissionDescription(PermissionType type,
|
| const GURL& origin,
|
| const GURL& embedding_origin);
|
| bool operator==(const PermissionDescription& other) const;
|
| + bool operator!=(const PermissionDescription& other) const;
|
|
|
| // Hash operator for hash maps.
|
| struct Hash {
|
| @@ -71,10 +74,15 @@ class LayoutTestPermissionManager : public PermissionManager {
|
| GURL embedding_origin;
|
| };
|
|
|
| + struct Subscription;
|
| + using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>;
|
| using PermissionsMap = base::hash_map<PermissionDescription,
|
| PermissionStatus,
|
| PermissionDescription::Hash>;
|
|
|
| + void OnPermissionChanged(const PermissionDescription& permission,
|
| + PermissionStatus status);
|
| +
|
| // Mutex for permissions access. Unfortunately, the permissions can be
|
| // accessed from the IO thread because of Notifications' synchronous IPC.
|
| base::Lock permissions_lock_;
|
| @@ -83,6 +91,9 @@ class LayoutTestPermissionManager : public PermissionManager {
|
| // their associated |PermissionStatus|.
|
| PermissionsMap permissions_;
|
|
|
| + // List of subscribers currently listening to permission changes.
|
| + SubscriptionsMap subscriptions_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(LayoutTestPermissionManager);
|
| };
|
|
|
|
|