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

Side by Side Diff: Source/platform/exported/WebMediaStreamSource.cpp

Issue 133733004: Adding owner access from WebMediaStreamTrack::ExtraData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
44 44
45 using namespace WebCore; 45 using namespace WebCore;
46 46
47 namespace blink { 47 namespace blink {
48 48
49 namespace { 49 namespace {
50 50
51 class ExtraDataContainer : public MediaStreamSource::ExtraData { 51 class ExtraDataContainer : public MediaStreamSource::ExtraData {
52 public: 52 public:
53 ExtraDataContainer(WebMediaStreamSource::ExtraData* extraData) : m_extraData (adoptPtr(extraData)) { } 53 ExtraDataContainer(PassOwnPtr<WebMediaStreamSource::ExtraData> extraData) : m_extraData(extraData) { }
54 54
55 WebMediaStreamSource::ExtraData* extraData() { return m_extraData.get(); } 55 WebMediaStreamSource::ExtraData* extraData() { return m_extraData.get(); }
56 56
57 private: 57 private:
58 OwnPtr<WebMediaStreamSource::ExtraData> m_extraData; 58 OwnPtr<WebMediaStreamSource::ExtraData> m_extraData;
59 }; 59 };
60 60
61 } // namespace 61 } // namespace
62 62
63 WebMediaStreamSource WebMediaStreamSource::ExtraData::owner() 63 WebMediaStreamSource WebMediaStreamSource::ExtraData::owner()
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return static_cast<ExtraDataContainer*>(data)->extraData(); 147 return static_cast<ExtraDataContainer*>(data)->extraData();
148 } 148 }
149 149
150 void WebMediaStreamSource::setExtraData(ExtraData* extraData) 150 void WebMediaStreamSource::setExtraData(ExtraData* extraData)
151 { 151 {
152 ASSERT(!m_private.isNull()); 152 ASSERT(!m_private.isNull());
153 153
154 if (extraData) 154 if (extraData)
155 extraData->setOwner(m_private.get()); 155 extraData->setOwner(m_private.get());
156 156
157 m_private->setExtraData(new ExtraDataContainer(extraData)); 157 m_private->setExtraData(adoptRef(new ExtraDataContainer(adoptPtr(extraData)) ));
158 } 158 }
159 159
160 WebMediaConstraints WebMediaStreamSource::constraints() 160 WebMediaConstraints WebMediaStreamSource::constraints()
161 { 161 {
162 ASSERT(!m_private.isNull()); 162 ASSERT(!m_private.isNull());
163 return m_private->constraints(); 163 return m_private->constraints();
164 } 164 }
165 165
166 bool WebMediaStreamSource::requiresAudioConsumer() const 166 bool WebMediaStreamSource::requiresAudioConsumer() const
167 { 167 {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>((*it).get()); 225 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>((*it).get());
226 if (wrapper->consumer() == consumer) { 226 if (wrapper->consumer() == consumer) {
227 m_private->removeAudioConsumer(wrapper); 227 m_private->removeAudioConsumer(wrapper);
228 return true; 228 return true;
229 } 229 }
230 } 230 }
231 return false; 231 return false;
232 } 232 }
233 233
234 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698