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

Unified Diff: chrome/browser/media/media_access_handler.h

Issue 1095393004: Refactor: Make MediaCaptureDevicesDispatcher have pluggable handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: chrome/browser/media/media_access_handler.h
diff --git a/chrome/browser/media/media_access_handler.h b/chrome/browser/media/media_access_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb040b11af7e1be59e6fc18c16767e03386dcfae
--- /dev/null
+++ b/chrome/browser/media/media_access_handler.h
@@ -0,0 +1,43 @@
+// Copyright (c) 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 CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
+#define CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
+
+#include <deque>
+#include <map>
+
+#include "content/public/browser/web_contents.h"
Sergey Ulanov 2015/04/24 22:43:51 WebContents can be forward-declared
changbin 2015/04/29 05:24:34 Done.
+#include "content/public/common/media_stream_request.h"
+
+namespace extensions {
+class Extension;
+}
+
+class MediaAccessHandler {
Sergey Ulanov 2015/04/24 22:43:51 Add comments to explain what this interface is use
changbin 2015/04/29 05:24:34 Done.
+ public:
+ MediaAccessHandler();
+ virtual ~MediaAccessHandler();
+
+ virtual void HandleRequest(content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback,
+ const extensions::Extension* extension) = 0;
+};
+
+struct PendingAccessRequest {
Sergey Ulanov 2015/04/24 22:43:51 This doesn't need to be in this header - they are
changbin 2015/04/29 05:24:34 Thanks, done. PTAL
+ PendingAccessRequest(const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback);
+ ~PendingAccessRequest();
+
+ // TODO(gbillock): make the MediaStreamDevicesController owned by
+ // this object when we're using bubbles.
+ content::MediaStreamRequest request;
+ content::MediaResponseCallback callback;
+};
+
+typedef std::deque<PendingAccessRequest> RequestsQueue;
+typedef std::map<content::WebContents*, RequestsQueue> RequestsQueues;
+
+#endif // CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698