Commit ecddc7ea authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

Move LongTaskDetector to core/loader

This is essentially a part of InteractiveDetector, belongs
to the loader.

Bug: none
Change-Id: I05bcf109b352c8054113003fe57b9de120af2bc0
Reviewed-on: https://chromium-review.googlesource.com/1149275Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577955}
parent 2fb02749
......@@ -1987,6 +1987,7 @@ jumbo_source_set("unit_tests") {
"loader/idleness_detector_test.cc",
"loader/interactive_detector_test.cc",
"loader/link_loader_test.cc",
"loader/long_task_detector_test.cc",
"loader/mixed_content_checker_test.cc",
"loader/modulescript/module_script_loader_test.cc",
"loader/modulescript/module_tree_linker_test.cc",
......
......@@ -48,6 +48,8 @@ blink_core_sources("loader") {
"link_loader.cc",
"link_loader.h",
"link_loader_client.h",
"long_task_detector.cc",
"long_task_detector.h",
"mixed_content_checker.cc",
"mixed_content_checker.h",
"modulescript/document_module_script_fetcher.cc",
......
......@@ -10,10 +10,10 @@
#include "base/time/time.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/context_lifecycle_observer.h"
#include "third_party/blink/renderer/core/loader/long_task_detector.h"
#include "third_party/blink/renderer/core/page/page_visibility_state.h"
#include "third_party/blink/renderer/core/paint/first_meaningful_paint_detector.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/long_task_detector.h"
#include "third_party/blink/renderer/platform/pod_interval.h"
#include "third_party/blink/renderer/platform/supplementable.h"
#include "third_party/blink/renderer/platform/timer.h"
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/platform/long_task_detector.h"
#include "third_party/blink/renderer/core/loader/long_task_detector.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_thread.h"
......
......@@ -2,19 +2,19 @@
// 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_PLATFORM_LONG_TASK_DETECTOR_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LONG_TASK_DETECTOR_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_LONG_TASK_DETECTOR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_LONG_TASK_DETECTOR_H_
#include "base/macros.h"
#include "base/task/sequence_manager/task_time_observer.h"
#include "third_party/blink/public/platform/web_thread.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/noncopyable.h"
#include "third_party/blink/renderer/platform/wtf/time.h"
namespace blink {
class PLATFORM_EXPORT LongTaskObserver : public GarbageCollectedMixin {
class CORE_EXPORT LongTaskObserver : public GarbageCollectedMixin {
public:
virtual ~LongTaskObserver() = default;
......@@ -26,11 +26,9 @@ class PLATFORM_EXPORT LongTaskObserver : public GarbageCollectedMixin {
// TaskTimeObserver on the main thread and observes every task. When the number
// of LongTaskObservers drop to zero it automatically removes itself as a
// TaskTimeObserver.
class PLATFORM_EXPORT LongTaskDetector final
class CORE_EXPORT LongTaskDetector final
: public GarbageCollectedFinalized<LongTaskDetector>,
public base::sequence_manager::TaskTimeObserver {
WTF_MAKE_NONCOPYABLE(LongTaskDetector);
public:
static LongTaskDetector& Instance();
......@@ -51,8 +49,10 @@ class PLATFORM_EXPORT LongTaskDetector final
base::TimeTicks end_time) override;
HeapHashSet<Member<LongTaskObserver>> observers_;
DISALLOW_COPY_AND_ASSIGN(LongTaskDetector);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LONG_TASK_DETECTOR_H_
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_LONG_TASK_DETECTOR_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/platform/long_task_detector.h"
#include "third_party/blink/renderer/core/loader/long_task_detector.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/cross_thread_functional.h"
......
......@@ -1164,8 +1164,6 @@ jumbo_component("platform") {
"lifecycle_observer.h",
"link_hash.cc",
"link_hash.h",
"long_task_detector.cc",
"long_task_detector.h",
"mac/block_exceptions.h",
"mac/block_exceptions.mm",
"mac/color_mac.h",
......@@ -1823,7 +1821,6 @@ jumbo_source_set("blink_platform_unittests_sources") {
"json/json_values_test.cc",
"layout_unit_test.cc",
"lifecycle_context_test.cc",
"long_task_detector_test.cc",
"mac/graphics_context_canvas_test.mm",
"mac/version_util_mac_test.mm",
"mhtml/mhtml_parser_test.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment