https://bugs.webkit.org/show_bug.cgi?id=175010
Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-07-31
Reviewed by Alex Christensen.
No new tests because no behavior change.
Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
* dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
* dom/QualifiedName.cpp:
(WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
instead of placement new.
* dom/QualifiedName.h: Use LazyNeverDestroyed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220089
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-07-31 Fujii Hironori <Hironori.Fujii@sony.com>
+
+ Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
+ https://bugs.webkit.org/show_bug.cgi?id=175010
+
+ Reviewed by Alex Christensen.
+
+ No new tests because no behavior change.
+
+ Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.
+
+ * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
+ * dom/QualifiedName.cpp:
+ (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
+ instead of placement new.
+ * dom/QualifiedName.h: Use LazyNeverDestroyed.
+
2017-07-31 Matt Rajca <mrajca@apple.com>
Support quirk for letting media autoplay if the user interacted with at least one media element.
#include "ProcessingInstruction.cpp"
#include "ProgressEvent.cpp"
#include "PseudoElement.cpp"
-// Build error if adding QualifiedName.cpp to DOMAllInOne.cpp
-// https://bugs.webkit.org/show_bug.cgi?id=146586
-// #include "QualifiedName.cpp"
+#include "QualifiedName.cpp"
#include "RadioButtonGroups.cpp"
#include "Range.cpp"
#include "RejectedPromiseTracker.cpp"
*/
#include "config.h"
-
-#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
-#define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1
-#else
-#define QNAME_DEFAULT_CONSTRUCTOR
-#endif
-
#include "QualifiedName.h"
+
#include "QualifiedNameCache.h"
#include "ThreadGlobalData.h"
#include <wtf/Assertions.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/StaticConstructors.h>
namespace WebCore {
}
// Global init routines
-DEFINE_GLOBAL(QualifiedName, anyName, nullAtom(), starAtom(), starAtom())
+LazyNeverDestroyed<const QualifiedName> anyName;
void QualifiedName::init()
{
if (initialized)
return;
- // Use placement new to initialize the globals.
AtomicString::init();
- new (NotNull, (void*)&anyName) QualifiedName(nullAtom(), starAtom(), starAtom());
+ anyName.construct(nullAtom(), starAtom(), starAtom());
initialized = true;
}
#pragma once
#include <wtf/HashTraits.h>
+#include <wtf/NeverDestroyed.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
RefPtr<QualifiedNameImpl> m_impl;
};
-#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
-extern const QualifiedName anyName;
+extern LazyNeverDestroyed<const QualifiedName> anyName;
inline const QualifiedName& anyQName() { return anyName; }
-#endif
const QualifiedName& nullQName();