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

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

Issue 2433773006: Remove ExecutionContext::activeDOMObjectsAreStopped()
Patch Set: Created 4 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 // 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/SetSinkIdCallbacks.h" 5 #include "modules/audio_output_devices/SetSinkIdCallbacks.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" 9 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h"
10 10
(...skipping 24 matching lines...) Expand all
35 SetSinkIdCallbacks::SetSinkIdCallbacks(ScriptPromiseResolver* resolver, 35 SetSinkIdCallbacks::SetSinkIdCallbacks(ScriptPromiseResolver* resolver,
36 HTMLMediaElement& element, 36 HTMLMediaElement& element,
37 const String& sinkId) 37 const String& sinkId)
38 : m_resolver(resolver), m_element(element), m_sinkId(sinkId) { 38 : m_resolver(resolver), m_element(element), m_sinkId(sinkId) {
39 ASSERT(m_resolver); 39 ASSERT(m_resolver);
40 } 40 }
41 41
42 SetSinkIdCallbacks::~SetSinkIdCallbacks() {} 42 SetSinkIdCallbacks::~SetSinkIdCallbacks() {}
43 43
44 void SetSinkIdCallbacks::onSuccess() { 44 void SetSinkIdCallbacks::onSuccess() {
45 if (!m_resolver->getExecutionContext() || 45 if (!m_resolver->getExecutionContext())
46 m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
47 return; 46 return;
48 47
49 HTMLMediaElementAudioOutputDevice& aodElement = 48 HTMLMediaElementAudioOutputDevice& aodElement =
50 HTMLMediaElementAudioOutputDevice::from(*m_element); 49 HTMLMediaElementAudioOutputDevice::from(*m_element);
51 aodElement.setSinkId(m_sinkId); 50 aodElement.setSinkId(m_sinkId);
52 m_resolver->resolve(); 51 m_resolver->resolve();
53 } 52 }
54 53
55 void SetSinkIdCallbacks::onError(WebSetSinkIdError error) { 54 void SetSinkIdCallbacks::onError(WebSetSinkIdError error) {
56 if (!m_resolver->getExecutionContext() || 55 if (!m_resolver->getExecutionContext())
57 m_resolver->getExecutionContext()->activeDOMObjectsAreStopped())
58 return; 56 return;
59 57
60 m_resolver->reject(ToException(error)); 58 m_resolver->reject(ToException(error));
61 } 59 }
62 60
63 } // namespace blink 61 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698