diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-11-03 18:21:56 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-03 19:14:34 +0100 |
commit | 060ddd2a7a33b6d68696d39f0cdc8b81a9b4da99 (patch) | |
tree | 38b0b68f999744a00a71b23c93bd17412ef68f16 /Libraries/LibWeb/HighResolutionTime/Performance.h | |
parent | 565a26808dc187eef256020dc32de13458f37716 (diff) | |
download | serenity-060ddd2a7a33b6d68696d39f0cdc8b81a9b4da99.zip |
AK: Really disallow making OwnPtrs from refcounted types
This looks at three things:
- if the type has a typedef `AllowOwnPtr', respect that
- if not, disallow construction if both of `ref()' and `unref()' are
present.
Note that in the second case, if a type only defines `ref()' or only
defines `unref()', an OwnPtr can be created, as a RefPtr of that type
would be ill-formed.
Also marks a `Performance' to explicitly allow OwnPtrs.
Diffstat (limited to 'Libraries/LibWeb/HighResolutionTime/Performance.h')
-rw-r--r-- | Libraries/LibWeb/HighResolutionTime/Performance.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibWeb/HighResolutionTime/Performance.h b/Libraries/LibWeb/HighResolutionTime/Performance.h index 3d3bad0c65..6cb39f014e 100644 --- a/Libraries/LibWeb/HighResolutionTime/Performance.h +++ b/Libraries/LibWeb/HighResolutionTime/Performance.h @@ -26,6 +26,7 @@ #pragma once +#include <AK/StdLibExtras.h> #include <LibCore/ElapsedTimer.h> #include <LibWeb/Bindings/Wrappable.h> #include <LibWeb/DOM/EventTarget.h> @@ -37,6 +38,7 @@ class Performance final , public Bindings::Wrappable { public: using WrapperType = Bindings::PerformanceWrapper; + using AllowOwnPtr = AK::TrueType; explicit Performance(DOM::Window&); ~Performance(); |