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

Side by Side Diff: content/shell/browser/layout_test/layout_test_permission_manager.h

Issue 2496653002: Part 2 of base::IDMap refactor to eliminate IDMapOwnPointer/IDMapExternalPointer modes (Closed)
Patch Set: typedefs => using statements, update comments in base/id_map.h Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 struct Hash { 77 struct Hash {
78 size_t operator()(const PermissionDescription& description) const; 78 size_t operator()(const PermissionDescription& description) const;
79 }; 79 };
80 80
81 PermissionType type; 81 PermissionType type;
82 GURL origin; 82 GURL origin;
83 GURL embedding_origin; 83 GURL embedding_origin;
84 }; 84 };
85 85
86 struct Subscription; 86 struct Subscription;
87 using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; 87 using SubscriptionsMap = IDMap<std::unique_ptr<Subscription>>;
88 using PermissionsMap = base::hash_map<PermissionDescription, 88 using PermissionsMap = base::hash_map<PermissionDescription,
89 blink::mojom::PermissionStatus, 89 blink::mojom::PermissionStatus,
90 PermissionDescription::Hash>; 90 PermissionDescription::Hash>;
91 91
92 void OnPermissionChanged(const PermissionDescription& permission, 92 void OnPermissionChanged(const PermissionDescription& permission,
93 blink::mojom::PermissionStatus status); 93 blink::mojom::PermissionStatus status);
94 94
95 // Mutex for permissions access. Unfortunately, the permissions can be 95 // Mutex for permissions access. Unfortunately, the permissions can be
96 // accessed from the IO thread because of Notifications' synchronous IPC. 96 // accessed from the IO thread because of Notifications' synchronous IPC.
97 base::Lock permissions_lock_; 97 base::Lock permissions_lock_;
98 98
99 // List of permissions currently known by the LayoutTestPermissionManager and 99 // List of permissions currently known by the LayoutTestPermissionManager and
100 // their associated |PermissionStatus|. 100 // their associated |PermissionStatus|.
101 PermissionsMap permissions_; 101 PermissionsMap permissions_;
102 102
103 // List of subscribers currently listening to permission changes. 103 // List of subscribers currently listening to permission changes.
104 SubscriptionsMap subscriptions_; 104 SubscriptionsMap subscriptions_;
105 105
106 DISALLOW_COPY_AND_ASSIGN(LayoutTestPermissionManager); 106 DISALLOW_COPY_AND_ASSIGN(LayoutTestPermissionManager);
107 }; 107 };
108 108
109 } // namespace content 109 } // namespace content
110 110
111 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_ 111 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PERMISSION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698