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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamDescriptor.cpp

Issue 1363143003: [Oilpan] Move MediaStream{Source|Component|Descriptor} to Oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work for comments Created 5 years, 2 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 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 33
34 #include "platform/mediastream/MediaStreamDescriptor.h" 34 #include "platform/mediastream/MediaStreamDescriptor.h"
35 35
36 #include "platform/UUID.h" 36 #include "platform/UUID.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 PassRefPtr<MediaStreamDescriptor> MediaStreamDescriptor::create(const MediaStrea mSourceVector& audioSources, const MediaStreamSourceVector& videoSources) 40 MediaStreamDescriptor* MediaStreamDescriptor::create(const MediaStreamSourceVect or& audioSources, const MediaStreamSourceVector& videoSources)
41 { 41 {
42 return adoptRef(new MediaStreamDescriptor(createCanonicalUUIDString(), audio Sources, videoSources)); 42 return new MediaStreamDescriptor(createCanonicalUUIDString(), audioSources, videoSources);
43 } 43 }
44 44
45 PassRefPtr<MediaStreamDescriptor> MediaStreamDescriptor::create(const MediaStrea mComponentVector& audioComponents, const MediaStreamComponentVector& videoCompon ents) 45 MediaStreamDescriptor* MediaStreamDescriptor::create(const MediaStreamComponentV ector& audioComponents, const MediaStreamComponentVector& videoComponents)
46 { 46 {
47 return adoptRef(new MediaStreamDescriptor(createCanonicalUUIDString(), audio Components, videoComponents)); 47 return new MediaStreamDescriptor(createCanonicalUUIDString(), audioComponent s, videoComponents);
48 } 48 }
49 49
50 PassRefPtr<MediaStreamDescriptor> MediaStreamDescriptor::create(const String& id , const MediaStreamComponentVector& audioComponents, const MediaStreamComponentV ector& videoComponents) 50 MediaStreamDescriptor* MediaStreamDescriptor::create(const String& id, const Med iaStreamComponentVector& audioComponents, const MediaStreamComponentVector& vide oComponents)
51 { 51 {
52 return adoptRef(new MediaStreamDescriptor(id, audioComponents, videoComponen ts)); 52 return new MediaStreamDescriptor(id, audioComponents, videoComponents);
53 } 53 }
54 54
55 void MediaStreamDescriptor::addComponent(PassRefPtr<MediaStreamComponent> compon ent) 55 void MediaStreamDescriptor::addComponent(MediaStreamComponent* component)
56 { 56 {
57 switch (component->source()->type()) { 57 switch (component->source()->type()) {
58 case MediaStreamSource::TypeAudio: 58 case MediaStreamSource::TypeAudio:
59 if (m_audioComponents.find(component) == kNotFound) 59 if (m_audioComponents.find(component) == kNotFound)
60 m_audioComponents.append(component); 60 m_audioComponents.append(component);
61 break; 61 break;
62 case MediaStreamSource::TypeVideo: 62 case MediaStreamSource::TypeVideo:
63 if (m_videoComponents.find(component) == kNotFound) 63 if (m_videoComponents.find(component) == kNotFound)
64 m_videoComponents.append(component); 64 m_videoComponents.append(component);
65 break; 65 break;
66 } 66 }
67 } 67 }
68 68
69 void MediaStreamDescriptor::removeComponent(PassRefPtr<MediaStreamComponent> com ponent) 69 void MediaStreamDescriptor::removeComponent(MediaStreamComponent* component)
70 { 70 {
71 size_t pos = kNotFound; 71 size_t pos = kNotFound;
72 switch (component->source()->type()) { 72 switch (component->source()->type()) {
73 case MediaStreamSource::TypeAudio: 73 case MediaStreamSource::TypeAudio:
74 pos = m_audioComponents.find(component); 74 pos = m_audioComponents.find(component);
75 if (pos != kNotFound) 75 if (pos != kNotFound)
76 m_audioComponents.remove(pos); 76 m_audioComponents.remove(pos);
77 break; 77 break;
78 case MediaStreamSource::TypeVideo: 78 case MediaStreamSource::TypeVideo:
79 pos = m_videoComponents.find(component); 79 pos = m_videoComponents.find(component);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 , m_active(true) 119 , m_active(true)
120 , m_ended(false) 120 , m_ended(false)
121 { 121 {
122 ASSERT(m_id.length()); 122 ASSERT(m_id.length());
123 for (MediaStreamComponentVector::const_iterator iter = audioComponents.begin (); iter != audioComponents.end(); ++iter) 123 for (MediaStreamComponentVector::const_iterator iter = audioComponents.begin (); iter != audioComponents.end(); ++iter)
124 m_audioComponents.append((*iter)); 124 m_audioComponents.append((*iter));
125 for (MediaStreamComponentVector::const_iterator iter = videoComponents.begin (); iter != videoComponents.end(); ++iter) 125 for (MediaStreamComponentVector::const_iterator iter = videoComponents.begin (); iter != videoComponents.end(); ++iter)
126 m_videoComponents.append((*iter)); 126 m_videoComponents.append((*iter));
127 } 127 }
128 128
129 DEFINE_TRACE(MediaStreamDescriptor)
130 {
131 visitor->trace(m_audioComponents);
132 visitor->trace(m_videoComponents);
133 }
134
129 } // namespace blink 135 } // namespace blink
130
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698