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

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: 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
Index: Source/modules/presentation/Presentation.cpp
diff --git a/Source/modules/presentation/Presentation.cpp b/Source/modules/presentation/Presentation.cpp
index ac51b38c087e64c80392ae94541bbdba7c3269fa..387887bdbeddf3ea6a88a4eff70022bc9e8d7773 100644
--- a/Source/modules/presentation/Presentation.cpp
+++ b/Source/modules/presentation/Presentation.cpp
@@ -5,6 +5,8 @@
#include "config.h"
#include "modules/presentation/Presentation.h"
+#include "bindings/core/v8/ScriptPromise.h"
Peter Beverloo 2014/10/29 20:51:19 You already include this in the header.
whywhat 2014/10/29 22:09:26 IWYU (include what you use)
+#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "modules/EventTargetModules.h"
Peter Beverloo 2014/10/29 20:51:19 +#include "core/dom/DOMException.h"
whywhat 2014/10/29 22:09:26 Done.
namespace blink {
@@ -39,4 +41,27 @@ void Presentation::trace(Visitor* visitor)
EventTargetWithInlineData::trace(visitor);
}
+PresentationSession* Presentation::session() const
+{
+ return m_session.get();
Peter Beverloo 2014/10/29 20:51:19 visitor->trace(m_session);
whywhat 2014/10/29 22:09:26 Done.
+}
+
+ScriptPromise Presentation::startSession(ScriptState* state, const String& senderId, const String& presentationId)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state);
+ ScriptPromise promise = resolver->promise();
+ RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(NotSupportedError, "The method is not supported yet.");
+ resolver->reject(exception);
+ return promise;
+}
+
+ScriptPromise Presentation::joinSession(ScriptState* state, const String& senderId, const String& presentationId)
+{
+ RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(state);
+ ScriptPromise promise = resolver->promise();
+ RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(NotSupportedError, "The method is not supported yet.");
+ resolver->reject(exception);
Peter Beverloo 2014/10/29 20:51:19 Just call DOMException::create() as part of this c
whywhat 2014/10/29 22:09:26 Done.
+ return promise;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698