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

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

Issue 2410383002: VideoCapture: more migration IPC-->mojo, part 6 (Closed)
Patch Set: Comment correction Created 4 years, 2 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/renderer/media/video_capture_message_filter.h
diff --git a/content/renderer/media/video_capture_message_filter.h b/content/renderer/media/video_capture_message_filter.h
index 6314af080fc62883aa5d69bd212182ff6c970cf9..3a2917045862a55f8cd1fdc632fad1595ca07b3d 100644
--- a/content/renderer/media/video_capture_message_filter.h
+++ b/content/renderer/media/video_capture_message_filter.h
@@ -1,11 +1,6 @@
// Copyright (c) 2012 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.
-//
-// MessageFilter that handles video capture messages and delegates them to
-// video captures. VideoCaptureMessageFilter is operated on IO thread of
-// render process. It intercepts video capture messages and process them on
-// IO thread since these messages are time critical.
#ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_
#define CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_
@@ -15,28 +10,19 @@
#include <map>
#include "base/macros.h"
-#include "base/memory/shared_memory.h"
-#include "base/values.h"
#include "content/common/content_export.h"
-#include "content/common/media/video_capture.h"
#include "ipc/message_filter.h"
-#include "media/base/video_capture_types.h"
-#include "media/base/video_frame.h"
-
-struct VideoCaptureMsg_BufferReady_Params;
namespace content {
+// MessageFilter that notifies a (series of) Delegates of incoming video capture
+// connections. VideoCaptureMessageFilter is operated on IO thread of render
+// process.
class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::MessageFilter {
public:
class CONTENT_EXPORT Delegate {
public:
- // Called when a video frame buffer is created in the browser process.
- virtual void OnBufferCreated(base::SharedMemoryHandle handle,
- int length,
- int buffer_id) = 0;
-
- // Called when the delegate has been added to filter's delegate list.
+ // Called when a delegate has been added to the filter's delegate list.
// |device_id| is the device id for the delegate.
virtual void OnDelegateAdded(int32_t device_id) = 0;
@@ -48,13 +34,9 @@ class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::MessageFilter {
// Add a delegate to the map.
void AddDelegate(Delegate* delegate);
-
// Remove a delegate from the map.
void RemoveDelegate(Delegate* delegate);
- // Send a message asynchronously.
- virtual bool Send(IPC::Message* message);
-
IPC::Channel* channel() const { return channel_; }
// IPC::MessageFilter override. Called on IO thread.
@@ -63,24 +45,17 @@ class CONTENT_EXPORT VideoCaptureMessageFilter : public IPC::MessageFilter {
void OnFilterRemoved() override;
void OnChannelClosing() override;
+ void DoNothing() const {}
+
protected:
~VideoCaptureMessageFilter() override;
private:
- typedef std::map<int32_t, Delegate*> Delegates;
-
- // Receive a newly created buffer from browser process.
- void OnBufferCreated(int device_id,
- base::SharedMemoryHandle handle,
- int length,
- int buffer_id);
-
- // Finds the delegate associated with |device_id|, NULL if not found.
- Delegate* find_delegate(int device_id) const;
-
// A map of device ids to delegates.
+ using Delegates = std::map<int32_t, Delegate*>;
Delegates delegates_;
Delegates pending_delegates_;
+
int32_t last_device_id_;
IPC::Channel* channel_;

Powered by Google App Engine
This is Rietveld 408576698