Commit 91880a57 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Revert "Reland: Add UKM Document.OutliveTimeAfterShutdown"

This reverts commit 71c0f5b5.

Reason for revert: This CL logs to stderr on every test, causing the archive_webkit_layout_tests step to explode. See crbug.com/776334.

Original change's description:
> Reland: Add UKM Document.OutliveTimeAfterShutdown
>
> This is basically same as https://chromium-review.googlesource.com/c/chromium/src/+/647050.
> This CL tries to reland the change after rebasing.
>
> This CL adds a new UKM Document.OutliveTimeAfterShutdown, that is
> recorded when a Document object survives 5, 10, 20 or 50 garbage
> collections after detached. If a document outlives such long time, the
> document might be leaked. The UKM would be very useful to know where such
> leaky documents exist and to fix them.
>
> Design doc: https://docs.google.com/document/d/1fbs5smdd-pBLLMpq7u8EkyddZILtI7CZPJlo_AA1kak/edit?usp=sharing
>
> Bug: 757374
> Change-Id: I1f64d2a9260d898c386bb948dd25a1c5586f8eb7
> Reviewed-on: https://chromium-review.googlesource.com/722301
> Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Chris Palmer <palmer@chromium.org>
> Reviewed-by: Steven Holte <holte@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#510029}

TBR=palmer@chromium.org,hajimehoshi@chromium.org,haraken@chromium.org,holte@chromium.org

Change-Id: I59155476ced5620a87e027225f9f017c296813e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 757374
Reviewed-on: https://chromium-review.googlesource.com/729462
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510247}
parent 0eb1d376
...@@ -364,7 +364,6 @@ blink_core_sources("dom") { ...@@ -364,7 +364,6 @@ blink_core_sources("dom") {
deps = [ deps = [
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders",
"//services/metrics/public/interfaces", "//services/metrics/public/interfaces",
] ]
} }
...@@ -261,7 +261,6 @@ ...@@ -261,7 +261,6 @@
#include "public/platform/modules/insecure_input/insecure_input_service.mojom-blink.h" #include "public/platform/modules/insecure_input/insecure_input_service.mojom-blink.h"
#include "public/platform/site_engagement.mojom-blink.h" #include "public/platform/site_engagement.mojom-blink.h"
#include "services/metrics/public/cpp/mojo_ukm_recorder.h" #include "services/metrics/public/cpp/mojo_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/interfaces/ukm_interface.mojom-shared.h" #include "services/metrics/public/interfaces/ukm_interface.mojom-shared.h"
#include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/interface_provider.h"
...@@ -312,7 +311,6 @@ class DocumentOutliveTimeReporter : public BlinkGCObserver { ...@@ -312,7 +311,6 @@ class DocumentOutliveTimeReporter : public BlinkGCObserver {
int outlive_time_count = GetOutliveTimeCount(); int outlive_time_count = GetOutliveTimeCount();
if (outlive_time_count == 5 || outlive_time_count == 10) { if (outlive_time_count == 5 || outlive_time_count == 10) {
const char* kUMAString = "Document.OutliveTimeAfterShutdown.GCCount"; const char* kUMAString = "Document.OutliveTimeAfterShutdown.GCCount";
if (outlive_time_count == 5) if (outlive_time_count == 5)
UMA_HISTOGRAM_ENUMERATION(kUMAString, kGCCount5, kGCCountMax); UMA_HISTOGRAM_ENUMERATION(kUMAString, kGCCount5, kGCCountMax);
else if (outlive_time_count == 10) else if (outlive_time_count == 10)
...@@ -320,11 +318,6 @@ class DocumentOutliveTimeReporter : public BlinkGCObserver { ...@@ -320,11 +318,6 @@ class DocumentOutliveTimeReporter : public BlinkGCObserver {
else else
NOTREACHED(); NOTREACHED();
} }
if (outlive_time_count == 5 || outlive_time_count == 10 ||
outlive_time_count == 20 || outlive_time_count == 50) {
document_->RecordUkmOutliveTimeAfterShutdown(outlive_time_count);
}
} }
private: private:
...@@ -3706,17 +3699,8 @@ void Document::SetURL(const KURL& url) { ...@@ -3706,17 +3699,8 @@ void Document::SetURL(const KURL& url) {
UpdateBaseURL(); UpdateBaseURL();
GetContextFeatures().UrlDidChange(this); GetContextFeatures().UrlDidChange(this);
if (!ukm_recorder_ && IsInMainFrame()) { if (ukm_recorder_)
ukm::mojom::UkmRecorderInterfacePtr interface;
frame_->GetInterfaceProvider().GetInterface(mojo::MakeRequest(&interface));
ukm_source_id_ = ukm::UkmRecorder::GetNewSourceID();
ukm_recorder_.reset(new ukm::MojoUkmRecorder(std::move(interface)));
}
if (ukm_recorder_) {
DCHECK(IsInMainFrame());
ukm_recorder_->UpdateSourceURL(ukm_source_id_, url_); ukm_recorder_->UpdateSourceURL(ukm_source_id_, url_);
}
} }
KURL Document::ValidBaseElementURL() const { KURL Document::ValidBaseElementURL() const {
......
...@@ -1391,8 +1391,6 @@ class CORE_EXPORT Document : public ContainerNode, ...@@ -1391,8 +1391,6 @@ class CORE_EXPORT Document : public ContainerNode,
ukm::UkmRecorder* UkmRecorder(); ukm::UkmRecorder* UkmRecorder();
int64_t UkmSourceID() const; int64_t UkmSourceID() const;
void RecordUkmOutliveTimeAfterShutdown(int outlive_time_count);
protected: protected:
Document(const DocumentInit&, DocumentClassFlags = kDefaultDocumentClass); Document(const DocumentInit&, DocumentClassFlags = kDefaultDocumentClass);
......
...@@ -390,24 +390,6 @@ be describing additional metrics about the same event. ...@@ -390,24 +390,6 @@ be describing additional metrics about the same event.
</metric> </metric>
</event> </event>
<event name="Document.OutliveTimeAfterShutdown">
<owner>hajimehoshi@chromium.org</owner>
<owner>keishi@chromium.org</owner>
<summary>
Recorded when a Document object survives certain number of garbage
collections after detached. It is expected that regular Document objects are
destroyed soon after detached, and if a document outlives longer, probably
this can be leaked.
</summary>
<metric name="GCCount">
<summary>
Measures the numbers of garbarge collection after the document is
detached. This is recorded when the number reached certain numbers like 5
or 10.
</summary>
</metric>
</event>
<event name="Event.ScrollUpdate.Touch"> <event name="Event.ScrollUpdate.Touch">
<owner>nzolghadr@chromium.org</owner> <owner>nzolghadr@chromium.org</owner>
<summary> <summary>
......
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