summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/api/line_layout_api_shim.h
blob: b06d6a3643e710c42c675d54159f87315111b76e (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
// Copyright 2015 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_API_LINE_LAYOUT_API_SHIM_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_API_LINE_LAYOUT_API_SHIM_H_

#include "third_party/blink/renderer/core/layout/api/line_layout_item.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"

namespace blink {

class LayoutObject;

// TODO(pilgrim): Remove this kludge once clients have a real API and no longer
// need access to the underlying LayoutObject.
class LineLayoutAPIShim {
  STATIC_ONLY(LineLayoutAPIShim);

 public:
  static LayoutObject* LayoutObjectFrom(LineLayoutItem item) {
    return item.GetLayoutObject();
  }

  static const LayoutObject* ConstLayoutObjectFrom(LineLayoutItem item) {
    return item.GetLayoutObject();
  }
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_API_LINE_LAYOUT_API_SHIM_H_