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

Side by Side Diff: content/shell/test_runner/mock_webrtc_peer_connection_handler.cc

Issue 2710213005: Revert of Remove |remote| and |readonly| members of MediaStreamTrack (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shell/test_runner/mock_webrtc_peer_connection_handler.h" 5 #include "content/shell/test_runner/mock_webrtc_peer_connection_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 blink::WebVector<blink::WebMediaStreamTrack> local_audio_tracks; 399 blink::WebVector<blink::WebMediaStreamTrack> local_audio_tracks;
400 stream.audioTracks(local_audio_tracks); 400 stream.audioTracks(local_audio_tracks);
401 blink::WebVector<blink::WebMediaStreamTrack> remote_audio_tracks( 401 blink::WebVector<blink::WebMediaStreamTrack> remote_audio_tracks(
402 local_audio_tracks.size()); 402 local_audio_tracks.size());
403 403
404 for (size_t i = 0; i < local_audio_tracks.size(); ++i) { 404 for (size_t i = 0; i < local_audio_tracks.size(); ++i) {
405 blink::WebMediaStreamSource webkit_source; 405 blink::WebMediaStreamSource webkit_source;
406 webkit_source.initialize(local_audio_tracks[i].id(), 406 webkit_source.initialize(local_audio_tracks[i].id(),
407 blink::WebMediaStreamSource::TypeAudio, 407 blink::WebMediaStreamSource::TypeAudio,
408 local_audio_tracks[i].id()); 408 local_audio_tracks[i].id(), true /* remote */);
409 remote_audio_tracks[i].initialize(webkit_source); 409 remote_audio_tracks[i].initialize(webkit_source);
410 } 410 }
411 411
412 blink::WebVector<blink::WebMediaStreamTrack> local_video_tracks; 412 blink::WebVector<blink::WebMediaStreamTrack> local_video_tracks;
413 stream.videoTracks(local_video_tracks); 413 stream.videoTracks(local_video_tracks);
414 blink::WebVector<blink::WebMediaStreamTrack> remote_video_tracks( 414 blink::WebVector<blink::WebMediaStreamTrack> remote_video_tracks(
415 local_video_tracks.size()); 415 local_video_tracks.size());
416 for (size_t i = 0; i < local_video_tracks.size(); ++i) { 416 for (size_t i = 0; i < local_video_tracks.size(); ++i) {
417 blink::WebMediaStreamSource webkit_source; 417 blink::WebMediaStreamSource webkit_source;
418 webkit_source.initialize(local_video_tracks[i].id(), 418 webkit_source.initialize(local_video_tracks[i].id(),
419 blink::WebMediaStreamSource::TypeVideo, 419 blink::WebMediaStreamSource::TypeVideo,
420 local_video_tracks[i].id()); 420 local_video_tracks[i].id(), true /* remote */);
421 remote_video_tracks[i].initialize(webkit_source); 421 remote_video_tracks[i].initialize(webkit_source);
422 } 422 }
423 423
424 blink::WebMediaStream new_remote_stream; 424 blink::WebMediaStream new_remote_stream;
425 new_remote_stream.initialize(remote_audio_tracks, remote_video_tracks); 425 new_remote_stream.initialize(remote_audio_tracks, remote_video_tracks);
426 remote_streams_[added_it->first] = new_remote_stream; 426 remote_streams_[added_it->first] = new_remote_stream;
427 client_->didAddRemoteStream(new_remote_stream); 427 client_->didAddRemoteStream(new_remote_stream);
428 ++added_it; 428 ++added_it;
429 } 429 }
430 } 430 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 const WebMediaStreamTrack& track) { 547 const WebMediaStreamTrack& track) {
548 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate()); 548 return new MockWebRTCDTMFSenderHandler(track, interfaces_->GetDelegate());
549 } 549 }
550 550
551 void MockWebRTCPeerConnectionHandler::stop() { 551 void MockWebRTCPeerConnectionHandler::stop() {
552 stopped_ = true; 552 stopped_ = true;
553 weak_factory_.InvalidateWeakPtrs(); 553 weak_factory_.InvalidateWeakPtrs();
554 } 554 }
555 555
556 } // namespace test_runner 556 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698