forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout_and_paint_async_then.cc
More file actions
29 lines (23 loc) · 972 Bytes
/
layout_and_paint_async_then.cc
File metadata and controls
29 lines (23 loc) · 972 Bytes
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
// 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.
#include "content/shell/test_runner/layout_and_paint_async_then.h"
#include "base/barrier_closure.h"
#include "base/callback.h"
#include "base/trace_event/trace_event.h"
#include "third_party/blink/public/web/web_page_popup.h"
#include "third_party/blink/public/web/web_widget.h"
namespace test_runner {
void LayoutAndPaintAsyncThen(blink::WebPagePopup* popup,
blink::WebWidget* web_widget,
base::OnceClosure callback) {
TRACE_EVENT0("shell", "LayoutAndPaintAsyncThen");
if (popup) {
auto barrier = base::BarrierClosure(2, std::move(callback));
web_widget->LayoutAndPaintAsync(barrier);
popup->LayoutAndPaintAsync(barrier);
} else {
web_widget->LayoutAndPaintAsync(std::move(callback));
}
}
} // namespace test_runner