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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStream.cpp

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011, 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 iter != video_tracks_.end(); ++iter) { 271 iter != video_tracks_.end(); ++iter) {
272 if ((*iter)->id() == id) 272 if ((*iter)->id() == id)
273 return iter->Get(); 273 return iter->Get();
274 } 274 }
275 275
276 return 0; 276 return 0;
277 } 277 }
278 278
279 MediaStream* MediaStream::clone(ScriptState* script_state) { 279 MediaStream* MediaStream::clone(ScriptState* script_state) {
280 MediaStreamTrackVector tracks; 280 MediaStreamTrackVector tracks;
281 ExecutionContext* context = script_state->GetExecutionContext(); 281 ExecutionContext* context = ExecutionContext::From(script_state);
282 for (MediaStreamTrackVector::iterator iter = audio_tracks_.begin(); 282 for (MediaStreamTrackVector::iterator iter = audio_tracks_.begin();
283 iter != audio_tracks_.end(); ++iter) 283 iter != audio_tracks_.end(); ++iter)
284 tracks.push_back((*iter)->clone(script_state)); 284 tracks.push_back((*iter)->clone(script_state));
285 for (MediaStreamTrackVector::iterator iter = video_tracks_.begin(); 285 for (MediaStreamTrackVector::iterator iter = video_tracks_.begin();
286 iter != video_tracks_.end(); ++iter) 286 iter != video_tracks_.end(); ++iter)
287 tracks.push_back((*iter)->clone(script_state)); 287 tracks.push_back((*iter)->clone(script_state));
288 return MediaStream::Create(context, tracks); 288 return MediaStream::Create(context, tracks);
289 } 289 }
290 290
291 void MediaStream::TrackEnded() { 291 void MediaStream::TrackEnded() {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 EventTargetWithInlineData::Trace(visitor); 431 EventTargetWithInlineData::Trace(visitor);
432 ContextClient::Trace(visitor); 432 ContextClient::Trace(visitor);
433 MediaStreamDescriptorClient::Trace(visitor); 433 MediaStreamDescriptorClient::Trace(visitor);
434 } 434 }
435 435
436 MediaStream* ToMediaStream(MediaStreamDescriptor* descriptor) { 436 MediaStream* ToMediaStream(MediaStreamDescriptor* descriptor) {
437 return static_cast<MediaStream*>(descriptor->Client()); 437 return static_cast<MediaStream*>(descriptor->Client());
438 } 438 }
439 439
440 } // namespace blink 440 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698