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

Side by Side Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.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 21 matching lines...) Expand all
32 #include "config.h" 32 #include "config.h"
33 #include "platform/mediastream/MediaStreamComponent.h" 33 #include "platform/mediastream/MediaStreamComponent.h"
34 34
35 #include "platform/UUID.h" 35 #include "platform/UUID.h"
36 #include "platform/audio/AudioBus.h" 36 #include "platform/audio/AudioBus.h"
37 #include "platform/mediastream/MediaStreamSource.h" 37 #include "platform/mediastream/MediaStreamSource.h"
38 #include "public/platform/WebAudioSourceProvider.h" 38 #include "public/platform/WebAudioSourceProvider.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 PassRefPtr<MediaStreamComponent> MediaStreamComponent::create(PassRefPtr<MediaSt reamSource> source) 42 MediaStreamComponent* MediaStreamComponent::create(MediaStreamSource* source)
43 { 43 {
44 return adoptRef(new MediaStreamComponent(createCanonicalUUIDString(), source )); 44 return new MediaStreamComponent(createCanonicalUUIDString(), source);
45 } 45 }
46 46
47 PassRefPtr<MediaStreamComponent> MediaStreamComponent::create(const String& id, PassRefPtr<MediaStreamSource> source) 47 MediaStreamComponent* MediaStreamComponent::create(const String& id, MediaStream Source* source)
48 { 48 {
49 return adoptRef(new MediaStreamComponent(id, source)); 49 return new MediaStreamComponent(id, source);
50 } 50 }
51 51
52 MediaStreamComponent::MediaStreamComponent(const String& id, PassRefPtr<MediaStr eamSource> source) 52 MediaStreamComponent::MediaStreamComponent(const String& id, MediaStreamSource* source)
53 : m_source(source) 53 : m_source(source)
54 , m_id(id) 54 , m_id(id)
55 , m_enabled(true) 55 , m_enabled(true)
56 , m_muted(false) 56 , m_muted(false)
57 { 57 {
58 ASSERT(m_id.length()); 58 ASSERT(m_id.length());
59 } 59 }
60 60
61 #if ENABLE(WEB_AUDIO) 61 #if ENABLE(WEB_AUDIO)
62 void MediaStreamComponent::AudioSourceProviderImpl::wrap(WebAudioSourceProvider* provider) 62 void MediaStreamComponent::AudioSourceProviderImpl::wrap(WebAudioSourceProvider* provider)
(...skipping 17 matching lines...) Expand all
80 // Wrap the AudioBus channel data using WebVector. 80 // Wrap the AudioBus channel data using WebVector.
81 size_t n = bus->numberOfChannels(); 81 size_t n = bus->numberOfChannels();
82 WebVector<float*> webAudioData(n); 82 WebVector<float*> webAudioData(n);
83 for (size_t i = 0; i < n; ++i) 83 for (size_t i = 0; i < n; ++i)
84 webAudioData[i] = bus->channel(i)->mutableData(); 84 webAudioData[i] = bus->channel(i)->mutableData();
85 85
86 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess); 86 m_webAudioSourceProvider->provideInput(webAudioData, framesToProcess);
87 } 87 }
88 #endif // #if ENABLE(WEB_AUDIO) 88 #endif // #if ENABLE(WEB_AUDIO)
89 89
90 DEFINE_TRACE(MediaStreamComponent)
91 {
92 visitor->trace(m_source);
93 }
94
90 } // namespace blink 95 } // namespace blink
91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698