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

Side by Side Diff: third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp

Issue 1983783002: Remove OwnPtr::release() calls in modules/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" 5 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 { 59 {
60 ExecutionContext* context = getExecutionContext(); 60 ExecutionContext* context = getExecutionContext();
61 ASSERT(context && context->isDocument()); 61 ASSERT(context && context->isDocument());
62 OwnPtr<SetSinkIdCallbacks> callbacks = adoptPtr(new SetSinkIdCallbacks(this, *m_element, m_sinkId)); 62 OwnPtr<SetSinkIdCallbacks> callbacks = adoptPtr(new SetSinkIdCallbacks(this, *m_element, m_sinkId));
63 WebMediaPlayer* webMediaPlayer = m_element->webMediaPlayer(); 63 WebMediaPlayer* webMediaPlayer = m_element->webMediaPlayer();
64 if (webMediaPlayer) { 64 if (webMediaPlayer) {
65 // Using leakPtr() to transfer ownership because |webMediaPlayer| is a p latform object that takes raw pointers 65 // Using leakPtr() to transfer ownership because |webMediaPlayer| is a p latform object that takes raw pointers
66 webMediaPlayer->setSinkId(m_sinkId, WebSecurityOrigin(context->getSecuri tyOrigin()), callbacks.leakPtr()); 66 webMediaPlayer->setSinkId(m_sinkId, WebSecurityOrigin(context->getSecuri tyOrigin()), callbacks.leakPtr());
67 } else { 67 } else {
68 if (AudioOutputDeviceClient* client = AudioOutputDeviceClient::from(cont ext)) { 68 if (AudioOutputDeviceClient* client = AudioOutputDeviceClient::from(cont ext)) {
69 client->checkIfAudioSinkExistsAndIsAuthorized(context, m_sinkId, cal lbacks.release()); 69 client->checkIfAudioSinkExistsAndIsAuthorized(context, m_sinkId, std ::move(callbacks));
70 } else { 70 } else {
71 // The context has been detached. Impossible to get a security origi n to check. 71 // The context has been detached. Impossible to get a security origi n to check.
72 ASSERT(context->activeDOMObjectsAreStopped()); 72 ASSERT(context->activeDOMObjectsAreStopped());
73 reject(DOMException::create(SecurityError, "Impossible to authorize device for detached context")); 73 reject(DOMException::create(SecurityError, "Impossible to authorize device for detached context"));
74 } 74 }
75 } 75 }
76 } 76 }
77 77
78 DEFINE_TRACE(SetSinkIdResolver) 78 DEFINE_TRACE(SetSinkIdResolver)
79 { 79 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 return *supplement; 126 return *supplement;
127 } 127 }
128 128
129 DEFINE_TRACE(HTMLMediaElementAudioOutputDevice) 129 DEFINE_TRACE(HTMLMediaElementAudioOutputDevice)
130 { 130 {
131 Supplement<HTMLMediaElement>::trace(visitor); 131 Supplement<HTMLMediaElement>::trace(visitor);
132 } 132 }
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698