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

Unified Diff: content/renderer/media/media_permission_dispatcher.h

Issue 1470233002: media: Generalize MediaPermissionDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 4 years, 10 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
« no previous file with comments | « no previous file | content/renderer/media/media_permission_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_permission_dispatcher.h
diff --git a/content/renderer/media/media_permission_dispatcher.h b/content/renderer/media/media_permission_dispatcher.h
index 853043d436924bd623c248c967d82d50f5514dfe..5396a45a92c5a2833414441d734d62ed57af4a26 100644
--- a/content/renderer/media/media_permission_dispatcher.h
+++ b/content/renderer/media/media_permission_dispatcher.h
@@ -9,12 +9,12 @@
#include <map>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "content/common/permission_service.mojom.h"
-#include "content/public/renderer/render_frame_observer.h"
#include "media/base/media_permission.h"
namespace base {
@@ -23,11 +23,14 @@ class SingleThreadTaskRunner;
namespace content {
-// MediaPermission implementation.
-class CONTENT_EXPORT MediaPermissionDispatcher : public media::MediaPermission,
- public RenderFrameObserver {
+// MediaPermission implementation using content PermissionService.
+class CONTENT_EXPORT MediaPermissionDispatcher : public media::MediaPermission {
public:
- explicit MediaPermissionDispatcher(RenderFrame* render_frame);
+ using ConnectToServiceCB =
+ base::Callback<void(mojo::InterfaceRequest<PermissionService>)>;
+
+ explicit MediaPermissionDispatcher(
+ const ConnectToServiceCB& connect_to_service_cb);
~MediaPermissionDispatcher() override;
// media::MediaPermission implementation.
@@ -52,6 +55,7 @@ class CONTENT_EXPORT MediaPermissionDispatcher : public media::MediaPermission,
// Callback for |permission_service_| calls.
void OnPermissionStatus(uint32_t request_id, PermissionStatus status);
+ ConnectToServiceCB connect_to_service_cb_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
uint32_t next_request_id_;
RequestMap requests_;
« no previous file with comments | « no previous file | content/renderer/media/media_permission_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698