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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp

Issue 2265363002: [Presentation API] make PresentationReceiver API consistent with latest spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix layout test global-interface-listing.html Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
index f7b4cbaf09ce26abe94dad1f992c119304be4fdf..fd03272d5c052b3d00787bd05b2b826bef223e68 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
@@ -6,10 +6,9 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "core/dom/DOMException.h"
-#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/frame/LocalFrame.h"
-#include "modules/EventTargetModules.h"
+#include "modules/presentation/PresentationConnectionList.h"
namespace blink {
@@ -18,29 +17,17 @@ PresentationReceiver::PresentationReceiver(LocalFrame* frame)
{
}
-const AtomicString& PresentationReceiver::interfaceName() const
+ScriptPromise PresentationReceiver::connectionList(ScriptState* scriptState)
{
- return EventTargetNames::PresentationReceiver;
-}
-
-ExecutionContext* PresentationReceiver::getExecutionContext() const
-{
- return frame() ? frame()->document() : nullptr;
-}
+ if (!m_connectionListProperty)
+ m_connectionListProperty = new ConnectionListProperty(scriptState->getExecutionContext(), this, ConnectionListProperty::Loaded);
-ScriptPromise PresentationReceiver::getConnection(ScriptState* scriptState)
-{
- return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError, "PresentationReceiver::getConnection() is not implemented yet."));
-}
-
-ScriptPromise PresentationReceiver::getConnections(ScriptState* scriptState)
-{
- return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError, "PresentationReceiver::getConnections() is not implemented yet."));
+ return m_connectionListProperty->promise(scriptState->world());
}
DEFINE_TRACE(PresentationReceiver)
{
- EventTargetWithInlineData::trace(visitor);
+ visitor->trace(m_connectionListProperty);
DOMWindowProperty::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698