| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/presentation/PresentationRequest.h" | 6 #include "modules/presentation/PresentationRequest.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 bool PresentationRequest::hasPendingActivity() const | 40 bool PresentationRequest::hasPendingActivity() const |
| 41 { | 41 { |
| 42 // Prevents garbage collecting of this object when not hold by another | 42 // Prevents garbage collecting of this object when not hold by another |
| 43 // object but still has listeners registered. | 43 // object but still has listeners registered. |
| 44 return hasEventListeners(); | 44 return hasEventListeners(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 ScriptPromise PresentationRequest::start(ScriptState* scriptState) | 47 ScriptPromise PresentationRequest::start(ScriptState* scriptState) |
| 48 { | 48 { |
| 49 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 | 49 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 |
| 50 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 50 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 51 ScriptPromise promise = resolver->promise(); | 51 ScriptPromise promise = resolver->promise(); |
| 52 return promise; | 52 return promise; |
| 53 } | 53 } |
| 54 | 54 |
| 55 ScriptPromise PresentationRequest::join(ScriptState* scriptState, const String&
id) | 55 ScriptPromise PresentationRequest::join(ScriptState* scriptState, const String&
id) |
| 56 { | 56 { |
| 57 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 | 57 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 |
| 58 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 58 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 59 ScriptPromise promise = resolver->promise(); | 59 ScriptPromise promise = resolver->promise(); |
| 60 return promise; | 60 return promise; |
| 61 } | 61 } |
| 62 | 62 |
| 63 ScriptPromise PresentationRequest::getAvailability(ScriptState* scriptState) | 63 ScriptPromise PresentationRequest::getAvailability(ScriptState* scriptState) |
| 64 { | 64 { |
| 65 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 | 65 // TODO(mlamouri): migrate from Presentation, see https://crbug.com/510483 |
| 66 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); | 66 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 67 ScriptPromise promise = resolver->promise(); | 67 ScriptPromise promise = resolver->promise(); |
| 68 return promise; | 68 return promise; |
| 69 } | 69 } |
| 70 | 70 |
| 71 const KURL& PresentationRequest::url() const | 71 const KURL& PresentationRequest::url() const |
| 72 { | 72 { |
| 73 return m_url; | 73 return m_url; |
| 74 } | 74 } |
| 75 | 75 |
| 76 DEFINE_TRACE(PresentationRequest) | 76 DEFINE_TRACE(PresentationRequest) |
| 77 { | 77 { |
| 78 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationRequest>::tr
ace(visitor); | 78 RefCountedGarbageCollectedEventTargetWithInlineData<PresentationRequest>::tr
ace(visitor); |
| 79 ActiveDOMObject::trace(visitor); | 79 ActiveDOMObject::trace(visitor); |
| 80 } | 80 } |
| 81 | 81 |
| 82 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con
st KURL& url) | 82 PresentationRequest::PresentationRequest(ExecutionContext* executionContext, con
st KURL& url) |
| 83 : ActiveDOMObject(executionContext) | 83 : ActiveDOMObject(executionContext) |
| 84 , m_url(url) | 84 , m_url(url) |
| 85 { | 85 { |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |