Chromium Code Reviews| Index: Source/modules/presentation/PresentationSession.cpp |
| diff --git a/Source/modules/presentation/PresentationSession.cpp b/Source/modules/presentation/PresentationSession.cpp |
| index a7920a0747f08f762c06e42e10cc656b282f16e3..97012e683c7d10462acdf70f8d5fd755cb5c1cf7 100644 |
| --- a/Source/modules/presentation/PresentationSession.cpp |
| +++ b/Source/modules/presentation/PresentationSession.cpp |
| @@ -5,12 +5,17 @@ |
| #include "config.h" |
| #include "modules/presentation/PresentationSession.h" |
| +#include "core/dom/Document.h" |
| +#include "core/frame/LocalFrame.h" |
| #include "modules/EventTargetModules.h" |
| +#include "public/platform/modules/presentation/WebPresentationSessionClient.h" |
| namespace blink { |
| -PresentationSession::PresentationSession(ExecutionContext* executionContext) |
| - : ContextLifecycleObserver(executionContext) |
| +PresentationSession::PresentationSession(LocalFrame* frame, WebPresentationSessionClient* client) |
| + : DOMWindowProperty(frame) |
| + , m_id(client->getId()) |
|
mlamouri (slow - plz ping)
2015/02/25 20:51:06
So if you only need the id, maybe you could only p
whywhat
2015/02/25 21:04:14
The client needs to outlive the callback since it
mlamouri (slow - plz ping)
2015/02/25 21:08:54
Understood. That's why you should pass the id only
whywhat
2015/02/25 22:46:52
Ok, I'll pass the presentation id and will use it
|
| + , m_state("disconnected") |
| { |
| } |
| @@ -19,9 +24,9 @@ PresentationSession::~PresentationSession() |
| } |
| // static |
| -PresentationSession* PresentationSession::create(ExecutionContext* executionContext) |
| +PresentationSession* PresentationSession::create(LocalFrame* frame, WebPresentationSessionClient* client) |
| { |
| - return new PresentationSession(executionContext); |
| + return new PresentationSession(frame, client); |
| } |
| const AtomicString& PresentationSession::interfaceName() const |
| @@ -31,13 +36,14 @@ const AtomicString& PresentationSession::interfaceName() const |
| ExecutionContext* PresentationSession::executionContext() const |
| { |
| - return ContextLifecycleObserver::executionContext(); |
| -} |
| + if (!frame()) |
| + return nullptr; |
| + return frame()->document();} |
| DEFINE_TRACE(PresentationSession) |
| { |
| RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSession>::trace(visitor); |
| - ContextLifecycleObserver::trace(visitor); |
| + DOMWindowProperty::trace(visitor); |
| } |
| void PresentationSession::postMessage(const String& message) |