summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.h
blob: 5038048ed31df7a80deafdb436403c6d8747f840 (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
41
42
43
44
45
46
// Copyright 2018 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_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_

#include "third_party/blink/renderer/core/layout/ng/custom/custom_layout_constraints_options.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"

namespace blink {

class ComputedStyle;
class CustomLayoutChild;
class CustomLayoutToken;
class NGConstraintSpace;
class SerializedScriptValue;
class ScriptPromiseResolver;

// Contains all the information needed to resolve a promise with a fragment or
// intrinsic-sizes.
class CustomLayoutWorkTask {
 public:
  CustomLayoutWorkTask(CustomLayoutChild*,
                       CustomLayoutToken*,
                       ScriptPromiseResolver*,
                       const CustomLayoutConstraintsOptions*,
                       scoped_refptr<SerializedScriptValue> constraint_data);
  ~CustomLayoutWorkTask();

  // Runs this work task.
  void Run(const NGConstraintSpace& parent_space,
           const ComputedStyle& parent_style);

 private:
  Persistent<CustomLayoutChild> child_;
  Persistent<CustomLayoutToken> token_;
  Persistent<ScriptPromiseResolver> resolver_;
  Persistent<const CustomLayoutConstraintsOptions> options_;
  scoped_refptr<SerializedScriptValue> constraint_data_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_CUSTOM_CUSTOM_LAYOUT_WORK_TASK_H_