summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HighResolutionTime
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-21 00:24:02 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-21 11:51:17 +0200
commitd4fc1367f6eb0ef463fd6e5676b2c852c7c73275 (patch)
treebfc65c3c5f85a8b28ebfa9ff5a9e34fb312d98d8 /Userland/Libraries/LibWeb/HighResolutionTime
parent270de12d5900f17c98bc9349ddc3f7fa6d9ce174 (diff)
downloadserenity-d4fc1367f6eb0ef463fd6e5676b2c852c7c73275.zip
LibWeb: Save document load timing when creating browsing context
Diffstat (limited to 'Userland/Libraries/LibWeb/HighResolutionTime')
-rw-r--r--Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.cpp19
-rw-r--r--Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.h14
2 files changed, 33 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.cpp
new file mode 100644
index 0000000000..0d5739e629
--- /dev/null
+++ b/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.cpp
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/HighResolutionTime/CoarsenTime.h>
+
+namespace Web::HighResolutionTime {
+
+// https://w3c.github.io/hr-time/#dfn-coarsen-time
+double coarsen_time(double timestamp, bool cross_origin_isolated_capability)
+{
+ // FIXME: Implement this.
+ (void)cross_origin_isolated_capability;
+ return timestamp;
+}
+
+}
diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.h b/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.h
new file mode 100644
index 0000000000..91fa541c46
--- /dev/null
+++ b/Userland/Libraries/LibWeb/HighResolutionTime/CoarsenTime.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+namespace Web::HighResolutionTime {
+
+// https://w3c.github.io/hr-time/#dfn-coarsen-time
+double coarsen_time(double timestamp, bool cross_origin_isolated_capability = false);
+
+}