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

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

Issue 140633004: Reland CL to implement browser-side logging to WebRtc log. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: These are the changes that should fix crbug.com/338848 Created 6 years, 11 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/media_stream_manager.h
diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h
index eefab6bdcb2087ddfc4890a8f7b1c93a3691050f..88f02e1f36cdfd0a2c9cdb940826bcb1aa11ffe1 100644
--- a/content/browser/renderer_host/media/media_stream_manager.h
+++ b/content/browser/renderer_host/media/media_stream_manager.h
@@ -24,6 +24,7 @@
#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_MANAGER_H_
#include <map>
+#include <set>
#include <string>
#include "base/basictypes.h"
@@ -185,6 +186,15 @@ class CONTENT_EXPORT MediaStreamManager
// too late. (see http://crbug.com/247525#c14).
virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ // Sends log messages to the render processes making device requests, to be
+ // used by the webrtcLoggingPrivate API if requested.
+ void AddLogMessageOnIOThread(const std::string& message);
+
+ // Adds |message| to native logs for outstanding device requests, for use by
+ // render processes requesting logging from webrtcLoggingPrivate API. Safe to
+ // call from any thread.
+ static void SendMessageToNativeLog(const std::string& message);
+
protected:
// Used for testing.
MediaStreamManager();
@@ -310,6 +320,12 @@ class CONTENT_EXPORT MediaStreamManager
void TranslateDeviceIdToSourceId(DeviceRequest* request,
MediaStreamDevice* device);
+ // Helper method that sends log messages to the render processes in
+ // |render_process_ids|, to be used by the webrtcLoggingPrivate API if
+ // requested.
+ void AddLogMessageOnUIThread(const std::set<int>& render_process_ids,
+ const std::string& message);
+
// Finds and returns the device id corresponding to the given
// |source_id|. Returns true if there was a raw device id that matched the
// given |source_id|, false if nothing matched it.
@@ -339,7 +355,7 @@ class CONTENT_EXPORT MediaStreamManager
// AudioInputDeviceManager, in order to only enumerate when necessary.
int active_enumeration_ref_count_[NUM_MEDIA_TYPES];
- // All non-closed request.
+ // All non-closed request. Must be accessed on IO thread.
DeviceRequests requests_;
// Hold a pointer to the IO loop to check we delete the device thread and

Powered by Google App Engine
This is Rietveld 408576698