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

Unified Diff: content/child/permissions/permission_observers_registry.h

Issue 1057453004: Permissions: glue between Mojo and Blink for permission observing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review commetns Created 5 years, 9 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/child/permissions/permission_observers_registry.h
diff --git a/content/child/permissions/permission_observers_registry.h b/content/child/permissions/permission_observers_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..5565bf88009a8fdadbc850bc200526b3aac48fa6
--- /dev/null
+++ b/content/child/permissions/permission_observers_registry.h
@@ -0,0 +1,35 @@
+// Copyright 2015 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 CONTENT_CHILD_PERMISSIONS_PERMISSION_OBSERVERS_REGISTRY_H_
+#define CONTENT_CHILD_PERMISSIONS_PERMISSION_OBSERVERS_REGISTRY_H_
+
+#include <set>
+
+namespace blink {
+class WebPermissionObserver;
+}
+
+namespace content {
+
+// PermissionObserversRegistry keeps a list of WebPermissionObserver with basic
+// methods to add/removed/check. It is being used by PermissionDispatcher and
+// PermissionDispatcherThreadProxy.
+// This is not thread-safe.
+class PermissionObserversRegistry {
+ public:
+ PermissionObserversRegistry();
+ ~PermissionObserversRegistry();
+
+ void RegisterObserver(blink::WebPermissionObserver* observer);
+ void UnregisterObserver(blink::WebPermissionObserver* observer);
+ bool IsObserverRegistered(blink::WebPermissionObserver* observer) const;
+
+ private:
+ std::set<blink::WebPermissionObserver*> observers_;
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_PERMISSIONS_PERMISSION_OBSERVERS_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698