Index: third_party/WebKit/Source/modules/ballista/Actions.h |
diff --git a/third_party/WebKit/Source/modules/ballista/Actions.h b/third_party/WebKit/Source/modules/ballista/Actions.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9bc0c0391628361e2d712ee3035f2018d315940b |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/ballista/Actions.h |
@@ -0,0 +1,68 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef Actions_h |
+#define Actions_h |
+ |
+#include "bindings/core/v8/ScriptPromise.h" |
+#include "bindings/core/v8/ScriptPromiseResolver.h" |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "content/common/ballista_service.mojom.h" |
Sam McNally
2016/04/01 02:51:25
You'll want to use the blink variant. Currently, t
Matt Giuca
2016/04/12 06:12:21
Done.
|
+#include "core/dom/ContextLifecycleObserver.h" |
+#include "core/events/EventTarget.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/HashSet.h" |
+ |
+namespace blink { |
+ |
+class Dictionary; |
+class ExecutionContext; |
+class ScriptPromise; |
+class ScriptState; |
+ |
+class Actions final |
+ : public GarbageCollectedFinalized<Actions>, |
+ public ScriptWrappable { |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ static Actions* create() |
+ { |
+ return new Actions(); |
+ } |
+ |
+ ~Actions(); |
+ |
+ // Actions interface |
+ ScriptPromise share(ScriptState*, const String&, const String&); |
+ |
+ DEFINE_INLINE_TRACE() { |
+ visitor->trace(m_clients); |
+ } |
+ |
+private: |
+ class BallistaClientImpl : public GarbageCollectedFinalized<BallistaClientImpl> { |
+ public: |
+ BallistaClientImpl(ScriptPromiseResolver* resolver); |
+ |
+ void bind(const mojo::String& error); |
+ |
+ DEFINE_INLINE_TRACE() |
+ { |
+ visitor->trace(m_resolver); |
+ } |
+ |
+ private: |
+ Member<ScriptPromiseResolver> m_resolver; |
+ }; |
+ |
+ Actions(); |
+ |
+ content::BallistaServicePtr m_service; |
+ |
+ HeapHashSet<Member<BallistaClientImpl>> m_clients; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // Actions_h |