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

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

Issue 1676043002: Deliver webrtc-internals updates in bulk, every 500ms at most. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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 | « content/content_tests.gypi ('k') | content/renderer/media/peer_connection_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/peer_connection_tracker.h
diff --git a/content/renderer/media/peer_connection_tracker.h b/content/renderer/media/peer_connection_tracker.h
index 63c55145e357fcb4736dfb76a358b211d638cd85..2181ca82b78676ef4225730a95ac2fdb8038d39b 100644
--- a/content/renderer/media/peer_connection_tracker.h
+++ b/content/renderer/media/peer_connection_tracker.h
@@ -163,16 +163,32 @@ class CONTENT_EXPORT PeerConnectionTracker
private:
// Assign a local ID to a peer connection so that the browser process can
// uniquely identify a peer connection in the renderer process.
+ // The return value will always be positive.
int GetNextLocalID();
+ // Looks up a handler in our map and if found, returns its ID. If the handler
+ // is not registered, the return value will be -1.
+ int GetLocalIDForHandler(RTCPeerConnectionHandler* handler) const;
+
// IPC Message handler for getting all stats.
void OnGetAllStats();
// Called when the browser process reports a suspend event from the OS.
void OnSuspend();
- void SendPeerConnectionUpdate(RTCPeerConnectionHandler* pc_handler,
- const std::string& callback_type,
+ // Called to deliver an update to the host (PeerConnectionTrackerHost).
+ // |local_id| - The id of the registered RTCPeerConnectionHandler.
+ // Using an id instead of the hander pointer is done on purpose
+ // to force doing the lookup before building the callback data
+ // in case the handler isn't registered.
+ // |callback_type| - A string, most often static, that represents the type
+ // of operation that the data stored in |value| comes from.
+ // E.g. "createOffer", "createAnswer",
+ // "setRemoteDescription" etc.
+ // |value| - A json serialized string containing all the information for the
+ // update event.
+ void SendPeerConnectionUpdate(int local_id,
+ const char* callback_type,
const std::string& value);
// This map stores the local ID assigned to each RTCPeerConnectionHandler.
@@ -180,7 +196,7 @@ class CONTENT_EXPORT PeerConnectionTracker
PeerConnectionIdMap peer_connection_id_map_;
// This keeps track of the next available local ID.
- int next_lid_;
+ int next_local_id_;
base::ThreadChecker main_thread_;
DISALLOW_COPY_AND_ASSIGN(PeerConnectionTracker);
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/media/peer_connection_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698