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

Unified Diff: Source/modules/presentation/Presentation.cpp

Issue 685263003: The rest of the Presentation API IDL as stubs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Specified types for the promises Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/presentation/Presentation.h ('k') | Source/modules/presentation/Presentation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/presentation/Presentation.cpp
diff --git a/Source/modules/presentation/Presentation.cpp b/Source/modules/presentation/Presentation.cpp
index ac51b38c087e64c80392ae94541bbdba7c3269fa..e017dfee3c0b8c086e9e220d7b642cfa1a238546 100644
--- a/Source/modules/presentation/Presentation.cpp
+++ b/Source/modules/presentation/Presentation.cpp
@@ -5,6 +5,10 @@
#include "config.h"
#include "modules/presentation/Presentation.h"
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "core/dom/DOMException.h"
#include "modules/EventTargetModules.h"
namespace blink {
@@ -37,6 +41,28 @@ ExecutionContext* Presentation::executionContext() const
void Presentation::trace(Visitor* visitor)
{
EventTargetWithInlineData::trace(visitor);
+ visitor->trace(m_session);
sof 2014/10/31 13:28:47 nit: the convention is to trace the local members
+}
+
+PresentationSession* Presentation::session() const
+{
+ return m_session.get();
+}
+
+ScriptPromise Presentation::startSession(ScriptState* state, const String& senderId, const String& presentationId)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state);
+ ScriptPromise promise = resolver->promise();
+ resolver->reject(DOMException::create(NotSupportedError, "The method is not supported yet."));
+ return promise;
+}
+
+ScriptPromise Presentation::joinSession(ScriptState* state, const String& senderId, const String& presentationId)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state);
+ ScriptPromise promise = resolver->promise();
+ resolver->reject(DOMException::create(NotSupportedError, "The method is not supported yet."));
+ return promise;
}
} // namespace blink
« no previous file with comments | « Source/modules/presentation/Presentation.h ('k') | Source/modules/presentation/Presentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698