Chromium Code Reviews| 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..f04220621228c2ca78b07c541f2e381fd311204d |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/ballista/Actions.h |
| @@ -0,0 +1,73 @@ |
| +// 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 "core/dom/ContextLifecycleObserver.h" |
| +#include "core/events/EventTarget.h" |
| +#include "platform/heap/Handle.h" |
| +#include "public/platform/modules/ballista/ballista.mojom-wtf.h" |
| +#include "wtf/HashSet.h" |
| + |
| +namespace blink { |
| + |
| +class Dictionary; |
| +class Document; |
| +class ExecutionContext; |
| +class LocalFrame; |
| +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> { |
|
Sam McNally
2016/04/13 04:32:35
Does this need to be defined inline?
Matt Giuca
2016/04/13 05:43:02
Done.
|
| + public: |
| + BallistaClientImpl(Actions*, ScriptPromiseResolver*); |
| + |
| + void callback(const String& error); |
| + |
| + DEFINE_INLINE_TRACE() |
| + { |
| + visitor->trace(m_actions); |
| + visitor->trace(m_resolver); |
| + } |
| + |
| + private: |
| + WeakMember<Actions> m_actions; |
| + Member<ScriptPromiseResolver> m_resolver; |
| + }; |
| + |
| + Actions(); |
| + |
| + Document* document(ScriptState*) const; |
| + LocalFrame* frame(ScriptState*) const; |
| + |
| + blink::mojom::wtf::BallistaServicePtr m_service; |
| + |
| + HeapHashSet<Member<BallistaClientImpl>> m_clients; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // Actions_h |