OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ASSERT(m_owner); | 62 ASSERT(m_owner); |
63 return WebMediaStreamSource(m_owner); | 63 return WebMediaStreamSource(m_owner); |
64 } | 64 } |
65 | 65 |
66 void WebMediaStreamSource::ExtraData::setOwner(MediaStreamSource* owner) | 66 void WebMediaStreamSource::ExtraData::setOwner(MediaStreamSource* owner) |
67 { | 67 { |
68 ASSERT(!m_owner); | 68 ASSERT(!m_owner); |
69 m_owner = owner; | 69 m_owner = owner; |
70 } | 70 } |
71 | 71 |
72 WebMediaStreamSource::WebMediaStreamSource(MediaStreamSource* mediaStreamSource) | 72 WebMediaStreamSource::WebMediaStreamSource(const PassRefPtr<MediaStreamSource>&
mediaStreamSource) |
73 : m_private(mediaStreamSource) | 73 : m_private(mediaStreamSource) |
74 { | 74 { |
75 } | 75 } |
76 | 76 |
77 WebMediaStreamSource& WebMediaStreamSource::operator=(MediaStreamSource* mediaSt
reamSource) | 77 WebMediaStreamSource& WebMediaStreamSource::operator=(MediaStreamSource* mediaSt
reamSource) |
78 { | 78 { |
79 m_private = mediaStreamSource; | 79 m_private = mediaStreamSource; |
80 return *this; | 80 return *this; |
81 } | 81 } |
82 | 82 |
83 void WebMediaStreamSource::assign(const WebMediaStreamSource& other) | 83 void WebMediaStreamSource::assign(const WebMediaStreamSource& other) |
84 { | 84 { |
85 m_private = other.m_private; | 85 m_private = other.m_private; |
86 } | 86 } |
87 | 87 |
88 void WebMediaStreamSource::reset() | 88 void WebMediaStreamSource::reset() |
89 { | 89 { |
90 m_private.reset(); | 90 m_private.reset(); |
91 } | 91 } |
92 | 92 |
| 93 WebMediaStreamSource::operator PassRefPtr<MediaStreamSource>() const |
| 94 { |
| 95 return m_private.get(); |
| 96 } |
| 97 |
93 WebMediaStreamSource::operator MediaStreamSource*() const | 98 WebMediaStreamSource::operator MediaStreamSource*() const |
94 { | 99 { |
95 return m_private.get(); | 100 return m_private.get(); |
96 } | 101 } |
97 | 102 |
98 void WebMediaStreamSource::initialize(const WebString& id, Type type, const WebS
tring& name) | 103 void WebMediaStreamSource::initialize(const WebString& id, Type type, const WebS
tring& name) |
99 { | 104 { |
100 m_private = MediaStreamSource::create(id, static_cast<MediaStreamSource::Typ
e>(type), name); | 105 m_private = MediaStreamSource::create(id, static_cast<MediaStreamSource::Typ
e>(type), name); |
101 } | 106 } |
102 | 107 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); | 222 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); |
218 if (wrapper->consumer() == consumer) { | 223 if (wrapper->consumer() == consumer) { |
219 m_private->removeAudioConsumer(wrapper); | 224 m_private->removeAudioConsumer(wrapper); |
220 return true; | 225 return true; |
221 } | 226 } |
222 } | 227 } |
223 return false; | 228 return false; |
224 } | 229 } |
225 | 230 |
226 } // namespace blink | 231 } // namespace blink |
OLD | NEW |