summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/launch/launch_queue.h
blob: b683f1e21d1c38febbd307c3a2b157ee90c6ffeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019 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 THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_LAUNCH_QUEUE_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_LAUNCH_QUEUE_H_

#include "third_party/blink/renderer/modules/launch/launch_params.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"

namespace blink {

class V8LaunchConsumer;
class Visitor;

class LaunchQueue final : public ScriptWrappable {
  DEFINE_WRAPPERTYPEINFO();

 public:
  LaunchQueue();
  ~LaunchQueue() override;

  void Enqueue(LaunchParams* params);

  // IDL implementation:
  void setConsumer(V8LaunchConsumer*);

  // ScriptWrappable:
  void Trace(Visitor* visitor) override;

 private:
  HeapVector<Member<LaunchParams>> unconsumed_launch_params_;
  Member<V8LaunchConsumer> consumer_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_LAUNCH_LAUNCH_QUEUE_H_