Chromium Code Reviews| 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..8ac0a774485c41dc0e84a7e7c8030716f9e420be 100644 |
| --- a/chrome/browser/media/desktop_streams_registry.cc |
| +++ b/chrome/browser/media/desktop_streams_registry.cc |
| @@ -31,8 +31,7 @@ DesktopStreamsRegistry::DesktopStreamsRegistry() {} |
| DesktopStreamsRegistry::~DesktopStreamsRegistry() {} |
| std::string DesktopStreamsRegistry::RegisterStream( |
| - int render_process_id, |
| - int render_view_id, |
| + const content::WebContents* web_contents, |
| const GURL& origin, |
| const content::DesktopMediaID& source, |
| const std::string& extension_name) { |
| @@ -40,8 +39,8 @@ std::string DesktopStreamsRegistry::RegisterStream( |
| std::string id = GenerateRandomStreamId(); |
| ApprovedDesktopMediaStream& stream = approved_streams_[id]; |
| - stream.render_process_id = render_process_id; |
| - stream.render_view_id = render_view_id; |
| + DCHECK(web_contents); |
| + stream.web_contents = web_contents; |
| stream.origin = origin; |
| stream.source = source; |
| stream.extension_name = extension_name; |
| @@ -57,8 +56,7 @@ std::string DesktopStreamsRegistry::RegisterStream( |
| content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId( |
| const std::string& id, |
| - int render_process_id, |
| - int render_view_id, |
| + const content::WebContents* web_contents, |
| const GURL& origin, |
| std::string* extension_name) { |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| @@ -68,8 +66,7 @@ content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId( |
| // Verify that if there is a request with the specified ID it was created for |
| // 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 || |
| + web_contents != it->second.web_contents || |
|
ncarter (slow)
2014/07/10 01:17:51
You can only match against a pointer value like th
miu
2014/07/10 22:16:12
Done.
|
| origin != it->second.origin) { |
| return content::DesktopMediaID(); |
| } |
| @@ -86,4 +83,4 @@ void DesktopStreamsRegistry::CleanupStream(const std::string& id) { |
| } |
| DesktopStreamsRegistry::ApprovedDesktopMediaStream::ApprovedDesktopMediaStream() |
| - : render_process_id(-1), render_view_id(-1) {} |
| + : web_contents(NULL) {} |