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

Side by Side Diff: content/renderer/media/media_stream_impl.cc

Issue 10968032: Removed the use of WebFrame::frameForCurrentContext() in MediaStreamImpl::requestUserMedia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/media_stream_impl.h" 5 #include "content/renderer/media/media_stream_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "content/renderer/media/capture_video_decoder.h" 13 #include "content/renderer/media/capture_video_decoder.h"
14 #include "content/renderer/media/media_stream_extra_data.h" 14 #include "content/renderer/media/media_stream_extra_data.h"
15 #include "content/renderer/media/media_stream_source_extra_data.h" 15 #include "content/renderer/media/media_stream_source_extra_data.h"
16 #include "content/renderer/media/media_stream_dependency_factory.h" 16 #include "content/renderer/media/media_stream_dependency_factory.h"
17 #include "content/renderer/media/media_stream_dispatcher.h" 17 #include "content/renderer/media/media_stream_dispatcher.h"
18 #include "content/renderer/media/rtc_video_decoder.h" 18 #include "content/renderer/media/rtc_video_decoder.h"
19 #include "content/renderer/media/video_capture_impl_manager.h" 19 #include "content/renderer/media/video_capture_impl_manager.h"
20 #include "content/renderer/media/webrtc_uma_histograms.h" 20 #include "content/renderer/media/webrtc_uma_histograms.h"
21 #include "media/base/message_loop_factory.h" 21 #include "media/base/message_loop_factory.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaStreamRegistr y.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaStreamRegistr y.h"
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amComponent.h" 26 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amComponent.h"
26 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amDescriptor.h" 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amDescriptor.h"
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amSource.h" 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre amSource.h"
28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
29 30
30 namespace { 31 namespace {
31 const int kVideoCaptureWidth = 640; 32 const int kVideoCaptureWidth = 640;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // We are in a test. 105 // We are in a test.
105 audio = audio_sources.size() > 0; 106 audio = audio_sources.size() > 0;
106 video = video_sources.size() > 0; 107 video = video_sources.size() > 0;
107 } else { 108 } else {
108 audio = user_media_request.audio(); 109 audio = user_media_request.audio();
109 video = user_media_request.video(); 110 video = user_media_request.video();
110 security_origin = GURL(user_media_request.securityOrigin().toString()); 111 security_origin = GURL(user_media_request.securityOrigin().toString());
111 // Get the WebFrame that requested a MediaStream. 112 // Get the WebFrame that requested a MediaStream.
112 // The frame is needed to tell the MediaStreamDispatcher when a stream goes 113 // The frame is needed to tell the MediaStreamDispatcher when a stream goes
113 // out of scope. 114 // out of scope.
114 frame = WebKit::WebFrame::frameForCurrentContext(); 115 frame = user_media_request.ownerDocument().frame();
115 DCHECK(frame); 116 DCHECK(frame);
116 } 117 }
117 118
118 DVLOG(1) << "MediaStreamImpl::generateStream(" << request_id << ", [ " 119 DVLOG(1) << "MediaStreamImpl::generateStream(" << request_id << ", [ "
119 << (audio ? "audio" : "") 120 << (audio ? "audio" : "")
120 << (user_media_request.video() ? " video" : "") << "], " 121 << (user_media_request.video() ? " video" : "") << "], "
121 << security_origin.spec() << ")"; 122 << security_origin.spec() << ")";
122 123
123 user_media_requests_[request_id] = 124 user_media_requests_[request_id] =
124 UserMediaRequestInfo(frame, user_media_request); 125 UserMediaRequestInfo(frame, user_media_request);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 MediaStreamExtraData::MediaStreamExtraData( 357 MediaStreamExtraData::MediaStreamExtraData(
357 webrtc::MediaStreamInterface* remote_stream) 358 webrtc::MediaStreamInterface* remote_stream)
358 : remote_stream_(remote_stream) { 359 : remote_stream_(remote_stream) {
359 } 360 }
360 MediaStreamExtraData::MediaStreamExtraData( 361 MediaStreamExtraData::MediaStreamExtraData(
361 webrtc::LocalMediaStreamInterface* local_stream) 362 webrtc::LocalMediaStreamInterface* local_stream)
362 : local_stream_(local_stream) { 363 : local_stream_(local_stream) {
363 } 364 }
364 MediaStreamExtraData::~MediaStreamExtraData() { 365 MediaStreamExtraData::~MediaStreamExtraData() {
365 } 366 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698