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

Unified Diff: content/browser/renderer_host/media/video_capture_host.h

Issue 24133002: Make VideoCaptureController single-threaded and not ref counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git pull Created 7 years, 3 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/browser/renderer_host/media/video_capture_host.h
diff --git a/content/browser/renderer_host/media/video_capture_host.h b/content/browser/renderer_host/media/video_capture_host.h
index d835b6cb3183c77e4ab67395c9b59dc1f35c77a1..6ce395631ebf8b04fb36de810e5c2532b64dafc4 100644
--- a/content/browser/renderer_host/media/video_capture_host.h
+++ b/content/browser/renderer_host/media/video_capture_host.h
@@ -39,6 +39,7 @@
#include <map>
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
#include "content/browser/renderer_host/media/video_capture_controller.h"
#include "content/common/content_export.h"
@@ -97,10 +98,10 @@ class CONTENT_EXPORT VideoCaptureHost
const media::VideoCaptureParams& params);
void OnControllerAdded(
int device_id, const media::VideoCaptureParams& params,
- VideoCaptureController* controller);
+ const base::WeakPtr<VideoCaptureController>& controller);
void DoControllerAddedOnIOThread(
int device_id, const media::VideoCaptureParams params,
- VideoCaptureController* controller);
+ const base::WeakPtr<VideoCaptureController>& controller);
// IPC message: Stop capture on device referenced by |device_id|.
void OnStopCapture(int device_id);
@@ -148,9 +149,12 @@ class CONTENT_EXPORT VideoCaptureHost
MediaStreamManager* media_stream_manager_;
- struct Entry;
- typedef std::map<VideoCaptureControllerID, Entry*> EntryMap;
- // A map of VideoCaptureControllerID to its state and VideoCaptureController.
+ typedef std::map<VideoCaptureControllerID,
+ base::WeakPtr<VideoCaptureController> > EntryMap;
+
+ // A map of VideoCaptureControllerID to the VideoCaptureController to which it
+ // is connected. An entry in this map holds a null controller while it is in
+ // the process of starting.
EntryMap entries_;
DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost);

Powered by Google App Engine
This is Rietveld 408576698