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

Unified Diff: chrome/browser/media/desktop_streams_registry.cc

Issue 364123002: [Cross-Site Isolation] Migrate entire MediaStream verticals to be per-RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It's random enough. + REBASE Created 6 years, 5 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/desktop_streams_registry.cc
diff --git a/chrome/browser/media/desktop_streams_registry.cc b/chrome/browser/media/desktop_streams_registry.cc
index f2e2607d63c9b40febd89be6e5dba7baf3bd393f..9f6a0ebec9c193fa49d1ff80a5b76cf542ee4c21 100644
--- a/chrome/browser/media/desktop_streams_registry.cc
+++ b/chrome/browser/media/desktop_streams_registry.cc
@@ -32,16 +32,17 @@ DesktopStreamsRegistry::~DesktopStreamsRegistry() {}
std::string DesktopStreamsRegistry::RegisterStream(
int render_process_id,
- int render_view_id,
+ int render_frame_id,
const GURL& origin,
const content::DesktopMediaID& source,
const std::string& extension_name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
std::string id = GenerateRandomStreamId();
+ DCHECK(approved_streams_.find(id) == approved_streams_.end());
ApprovedDesktopMediaStream& stream = approved_streams_[id];
stream.render_process_id = render_process_id;
- stream.render_view_id = render_view_id;
+ stream.render_frame_id = render_frame_id;
stream.origin = origin;
stream.source = source;
stream.extension_name = extension_name;
@@ -58,7 +59,7 @@ std::string DesktopStreamsRegistry::RegisterStream(
content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId(
const std::string& id,
int render_process_id,
- int render_view_id,
+ int render_frame_id,
const GURL& origin,
std::string* extension_name) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -69,7 +70,7 @@ content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId(
// the same origin and the same renderer.
if (it == approved_streams_.end() ||
render_process_id != it->second.render_process_id ||
- render_view_id != it->second.render_view_id ||
+ render_frame_id != it->second.render_frame_id ||
origin != it->second.origin) {
return content::DesktopMediaID();
}
@@ -86,4 +87,4 @@ void DesktopStreamsRegistry::CleanupStream(const std::string& id) {
}
DesktopStreamsRegistry::ApprovedDesktopMediaStream::ApprovedDesktopMediaStream()
- : render_process_id(-1), render_view_id(-1) {}
+ : render_process_id(-1), render_frame_id(-1) {}
« no previous file with comments | « chrome/browser/media/desktop_streams_registry.h ('k') | chrome/browser/media/media_capture_devices_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698