Changeset 214203 in webkit


Ignore:
Timestamp:
Mar 20, 2017 7:04:55 PM (7 years ago)
Author:
Simon Fraser
Message:

Optimize packing of Document and superclass data members
https://bugs.webkit.org/show_bug.cgi?id=169880

Reviewed by Antti Koivisto.

Move data members around to optimize packing in SecurityContext, SuspendableTimer and Document.
This saves as few hundred bytes on Document.

Padding detected via Tools/Scripts/dump-class-layout

  • dom/Document.cpp:

(WebCore::Document::Document):

  • dom/Document.h:
  • dom/ScriptExecutionContext.h:
  • dom/SecurityContext.cpp:

(WebCore::SecurityContext::SecurityContext):

  • dom/SecurityContext.h:
  • page/SuspendableTimer.cpp:

(WebCore::SuspendableTimer::SuspendableTimer):

  • page/SuspendableTimer.h:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r214195 r214203  
     12017-03-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Optimize packing of Document and superclass data members
     4        https://bugs.webkit.org/show_bug.cgi?id=169880
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Move data members around to optimize packing in SecurityContext, SuspendableTimer and Document.
     9        This saves as few hundred bytes on Document.
     10       
     11        Padding detected via Tools/Scripts/dump-class-layout
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::Document):
     15        * dom/Document.h:
     16        * dom/ScriptExecutionContext.h:
     17        * dom/SecurityContext.cpp:
     18        (WebCore::SecurityContext::SecurityContext):
     19        * dom/SecurityContext.h:
     20        * page/SuspendableTimer.cpp:
     21        (WebCore::SuspendableTimer::SuspendableTimer):
     22        * page/SuspendableTimer.h:
     23
    1242017-03-20  Chris Dumez  <cdumez@apple.com>
    225
  • trunk/Source/WebCore/dom/Document.cpp

    r214189 r214203  
    447447    , m_extensionStyleSheets(std::make_unique<ExtensionStyleSheets>(*this))
    448448    , m_visitedLinkState(std::make_unique<VisitedLinkState>(*this))
     449    , m_markers(std::make_unique<DocumentMarkerController>(*this))
    449450    , m_styleRecalcTimer(*this, &Document::updateStyleIfNeeded)
    450     , m_markers(std::make_unique<DocumentMarkerController>(*this))
    451451    , m_updateFocusAppearanceTimer(*this, &Document::updateFocusAppearanceTimerFired)
    452452    , m_documentCreationTime(MonotonicTime::now())
     
    455455    , m_xmlVersion(ASCIILiteral("1.0"))
    456456    , m_documentClasses(documentClasses)
    457     , m_isSynthesized(constructionFlags & Synthesized)
    458     , m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder)
    459457    , m_eventQueue(*this)
    460458    , m_weakFactory(this)
     
    463461#endif
    464462    , m_loadEventDelayTimer(*this, &Document::loadEventDelayTimerFired)
    465     , m_referrerPolicy(ReferrerPolicy::Default)
    466463#if PLATFORM(IOS)
    467464#if ENABLE(DEVICE_ORIENTATION)
     
    484481    , m_socketProvider(page() ? &page()->socketProvider() : nullptr)
    485482#endif
     483    , m_isSynthesized(constructionFlags & Synthesized)
     484    , m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder)
    486485{
    487486    allDocuments().add(this);
  • trunk/Source/WebCore/dom/Document.h

    r214137 r214203  
    12671267#endif
    12681268
     1269// FIXME: Find a better place for this functionality.
     1270#if ENABLE(TELEPHONE_NUMBER_DETECTION)
     1271    // These functions provide a two-level setting:
     1272    //    - A user-settable wantsTelephoneNumberParsing (at the Page / WebView level)
     1273    //    - A read-only telephoneNumberParsingAllowed which is set by the
     1274    //      document if it has the appropriate meta tag.
     1275    //    - isTelephoneNumberParsingEnabled() == isTelephoneNumberParsingAllowed() && page()->settings()->isTelephoneNumberParsingEnabled()
     1276    WEBCORE_EXPORT bool isTelephoneNumberParsingAllowed() const;
     1277    WEBCORE_EXPORT bool isTelephoneNumberParsingEnabled() const;
     1278#endif
     1279
    12691280    using ContainerNode::setAttributeEventListener;
    12701281    void setAttributeEventListener(const AtomicString& eventType, const QualifiedName& attributeName, const AtomicString& value);
     
    13481359#endif
    13491360
     1361#if ENABLE(TELEPHONE_NUMBER_DETECTION)
     1362    friend void setParserFeature(const String& key, const String& value, Document*, void* userData);
     1363    void setIsTelephoneNumberParsingAllowed(bool);
     1364#endif
     1365
    13501366    void setVisualUpdatesAllowed(ReadyState);
    13511367    void setVisualUpdatesAllowed(bool);
     
    13771393    bool shouldEnforceHTTP09Sandbox() const;
    13781394
    1379     unsigned m_referencingNodeCount { 0 };
     1395    void platformSuspendOrStopActiveDOMObjects();
    13801396
    13811397    const Ref<Settings> m_settings;
    13821398
    13831399    std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver;
    1384     bool m_hasNodesWithNonFinalStyle { false };
    1385     // But sometimes you need to ignore pending stylesheet count to
    1386     // force an immediate layout when requested by JS.
    1387     bool m_ignorePendingStylesheets { false };
    13881400
    13891401    RefPtr<DOMWindow> m_domWindow;
     
    13921404    Ref<CachedResourceLoader> m_cachedResourceLoader;
    13931405    RefPtr<DocumentParser> m_parser;
    1394     unsigned m_activeParserCount { 0 };
    1395 
    1396     bool m_wellFormed { false };
    13971406
    13981407    // Document URLs.
     
    14201429    std::unique_ptr<DOMImplementation> m_implementation;
    14211430
    1422     bool m_hasElementUsingStyleBasedEditability { false };
    1423 
    1424     bool m_printing { false };
    1425     bool m_paginatedForScreen { false };
    1426 
    1427     DocumentCompatibilityMode m_compatibilityMode { DocumentCompatibilityMode::NoQuirksMode };
    1428     bool m_compatibilityModeLocked { false }; // This is cheaper than making setCompatibilityMode virtual.
    1429 
    1430     Color m_textColor { Color::black };
    1431 
    1432     bool m_focusNavigationStartingNodeIsRemoved;
    14331431    RefPtr<Node> m_focusNavigationStartingNode;
    14341432    RefPtr<Element> m_focusedElement;
     
    14441442    HashSet<Range*> m_ranges;
    14451443
    1446     unsigned m_listenerTypes { 0 };
    1447 
    1448     MutationObserverOptions m_mutationObserverTypes { 0 };
    1449 
    14501444    std::unique_ptr<Style::Scope> m_styleScope;
    14511445    std::unique_ptr<ExtensionStyleSheets> m_extensionStyleSheets;
     
    14541448    std::unique_ptr<FormController> m_formController;
    14551449
     1450    Color m_textColor { Color::black };
    14561451    Color m_linkColor;
    14571452    Color m_visitedLinkColor;
     
    14591454    const std::unique_ptr<VisitedLinkState> m_visitedLinkState;
    14601455
    1461     bool m_visuallyOrdered { false };
    1462     ReadyState m_readyState { Complete };
    1463     bool m_bParsing { false }; // FIXME: rename
    1464 
    1465     Timer m_styleRecalcTimer;
    1466     bool m_pendingStyleRecalcShouldForce { false };
    1467     bool m_inStyleRecalc { false };
    1468     bool m_closeAfterStyleRecalc { false };
    1469     bool m_inRenderTreeUpdate { false };
    1470     unsigned m_lastStyleUpdateSizeForTesting { 0 };
    1471 
    1472     bool m_gotoAnchorNeededAfterStylesheetsLoad { false };
    1473     bool m_isDNSPrefetchEnabled { false };
    1474     bool m_haveExplicitlyDisabledDNSPrefetch { false };
    1475     bool m_frameElementsShouldIgnoreScrolling { false };
    1476     SelectionRestorationMode m_updateFocusAppearanceRestoresSelection { SelectionRestorationMode::SetDefault };
    1477 
    1478     // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-destructive-writes-counter
    1479     unsigned m_ignoreDestructiveWriteCount { 0 };
    1480 
    1481     // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
    1482     unsigned m_ignoreOpensDuringUnloadCount { 0 };
    1483 
    1484     unsigned m_styleRecalcCount { 0 };
    1485 
    14861456    StringWithDirection m_title;
    14871457    StringWithDirection m_rawTitle;
     
    14911461    const std::unique_ptr<DocumentMarkerController> m_markers;
    14921462   
     1463    Timer m_styleRecalcTimer;
    14931464    Timer m_updateFocusAppearanceTimer;
    14941465
    14951466    Element* m_cssTarget { nullptr };
     1467
     1468    RefPtr<SerializedScriptValue> m_pendingStateObject;
     1469    MonotonicTime m_documentCreationTime;
     1470    bool m_overMinimumLayoutThreshold { false };
     1471   
     1472    std::unique_ptr<ScriptRunner> m_scriptRunner;
     1473    std::unique_ptr<ScriptModuleLoader> m_moduleLoader;
     1474
     1475    Vector<RefPtr<HTMLScriptElement>> m_currentScriptStack;
     1476
     1477#if ENABLE(XSLT)
     1478    std::unique_ptr<TransformSource> m_transformSource;
     1479    RefPtr<Document> m_transformSourceDocument;
     1480#endif
     1481
     1482    String m_xmlEncoding;
     1483    String m_xmlVersion;
     1484    StandaloneStatus m_xmlStandalone { StandaloneUnspecified };
     1485    bool m_hasXMLDeclaration { false };
     1486
     1487    String m_contentLanguage;
     1488
     1489    RefPtr<TextResourceDecoder> m_decoder;
     1490
     1491    HashSet<LiveNodeList*> m_listsInvalidatedAtDocument;
     1492    HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument;
     1493    unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes];
     1494
     1495    RefPtr<XPathEvaluator> m_xpathEvaluator;
     1496
     1497    std::unique_ptr<SVGDocumentExtensions> m_svgExtensions;
     1498
     1499#if ENABLE(DASHBOARD_SUPPORT)
     1500    Vector<AnnotatedRegionValue> m_annotatedRegions;
     1501    bool m_hasAnnotatedRegions { false };
     1502    bool m_annotatedRegionsDirty { false };
     1503#endif
     1504
     1505    HashMap<String, RefPtr<HTMLCanvasElement>> m_cssCanvasElements;
     1506
     1507    HashSet<Element*> m_documentSuspensionCallbackElements;
     1508    HashSet<Element*> m_mediaVolumeCallbackElements;
     1509    HashSet<Element*> m_privateBrowsingStateChangedElements;
     1510#if ENABLE(VIDEO_TRACK)
     1511    HashSet<Element*> m_captionPreferencesChangedElements;
     1512#endif
     1513
     1514#if ENABLE(MEDIA_CONTROLS_SCRIPT)
     1515    HashSet<HTMLMediaElement*> m_pageScaleFactorChangedElements;
     1516    HashSet<HTMLMediaElement*> m_userInterfaceLayoutDirectionChangedElements;
     1517#endif
     1518
     1519    HashSet<Element*> m_visibilityStateCallbackElements;
     1520#if ENABLE(VIDEO)
     1521    HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements;
     1522#endif
     1523
     1524    HashMap<StringImpl*, Element*, ASCIICaseInsensitiveHash> m_elementsByAccessKey;
     1525
     1526    DocumentOrderedMap m_imagesByUsemap;
     1527
     1528    std::unique_ptr<SelectorQueryCache> m_selectorQueryCache;
     1529
     1530    DocumentClassFlags m_documentClasses;
     1531
     1532    RenderPtr<RenderView> m_renderView;
     1533    mutable DocumentEventQueue m_eventQueue;
     1534
     1535    WeakPtrFactory<Document> m_weakFactory;
     1536
     1537    HashSet<MediaCanStartListener*> m_mediaCanStartListeners;
     1538
     1539#if ENABLE(FULLSCREEN_API)
     1540    RefPtr<Element> m_fullScreenElement;
     1541    Vector<RefPtr<Element>> m_fullScreenElementStack;
     1542    RenderFullScreen* m_fullScreenRenderer { nullptr };
     1543    Timer m_fullScreenChangeDelayTimer;
     1544    Deque<RefPtr<Node>> m_fullScreenChangeEventTargetQueue;
     1545    Deque<RefPtr<Node>> m_fullScreenErrorEventTargetQueue;
     1546    LayoutRect m_savedPlaceholderFrameRect;
     1547    std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle;
     1548
     1549    bool m_areKeysEnabledInFullScreen { false };
     1550    bool m_isAnimatingFullScreen { false };
     1551#endif
     1552
     1553    HashSet<HTMLPictureElement*> m_viewportDependentPictures;
     1554
     1555    Timer m_loadEventDelayTimer;
     1556
     1557    ViewportArguments m_viewportArguments;
     1558
     1559#if ENABLE(WEB_TIMING)
     1560    DocumentTiming m_documentTiming;
     1561#endif
     1562
     1563    RefPtr<MediaQueryMatcher> m_mediaQueryMatcher;
     1564   
     1565#if ENABLE(TOUCH_EVENTS)
     1566    std::unique_ptr<EventTargetSet> m_touchEventTargets;
     1567#endif
     1568    std::unique_ptr<EventTargetSet> m_wheelEventTargets;
     1569
     1570    double m_lastHandledUserGestureTimestamp { 0 };
     1571
     1572    void clearScriptedAnimationController();
     1573    RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
     1574
     1575#if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS)
     1576    std::unique_ptr<DeviceMotionClient> m_deviceMotionClient;
     1577    std::unique_ptr<DeviceMotionController> m_deviceMotionController;
     1578    std::unique_ptr<DeviceOrientationClient> m_deviceOrientationClient;
     1579    std::unique_ptr<DeviceOrientationController> m_deviceOrientationController;
     1580#endif
     1581
     1582    Timer m_pendingTasksTimer;
     1583    Vector<Task> m_pendingTasks;
     1584
     1585#if ENABLE(TEXT_AUTOSIZING)
     1586public:
     1587    void addAutoSizedNode(Text&, float size);
     1588    void updateAutoSizedNodes();
     1589    void clearAutoSizedNodes();
     1590
     1591private:
     1592    using TextAutoSizingMap = HashMap<TextAutoSizingKey, std::unique_ptr<TextAutoSizingValue>, TextAutoSizingHash, TextAutoSizingTraits>;
     1593    TextAutoSizingMap m_textAutoSizedNodes;
     1594#endif
     1595
     1596    Timer m_visualUpdatesSuppressionTimer;
     1597
     1598    RefPtr<NamedFlowCollection> m_namedFlows;
     1599
     1600    void clearSharedObjectPool();
     1601    Timer m_sharedObjectPoolClearTimer;
     1602
     1603    std::unique_ptr<DocumentSharedObjectPool> m_sharedObjectPool;
     1604
     1605    typedef HashMap<AtomicString, std::unique_ptr<Locale>> LocaleIdentifierToLocaleMap;
     1606    LocaleIdentifierToLocaleMap m_localeCache;
     1607
     1608    RefPtr<Document> m_templateDocument;
     1609    Document* m_templateDocumentHost { nullptr }; // Manually managed weakref (backpointer from m_templateDocument).
     1610
     1611    Ref<CSSFontSelector> m_fontSelector;
     1612
     1613#if ENABLE(WEB_REPLAY)
     1614    Ref<JSC::InputCursor> m_inputCursor;
     1615#endif
     1616
     1617    HashSet<MediaProducer*> m_audioProducers;
     1618
     1619    HashSet<ShadowRoot*> m_inDocumentShadowRoots;
     1620
     1621#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     1622    typedef HashMap<uint64_t, WebCore::MediaPlaybackTargetClient*> TargetIdToClientMap;
     1623    TargetIdToClientMap m_idToClientMap;
     1624    typedef HashMap<WebCore::MediaPlaybackTargetClient*, uint64_t> TargetClientToIdMap;
     1625    TargetClientToIdMap m_clientToIDMap;
     1626#endif
     1627
     1628#if ENABLE(MEDIA_SESSION)
     1629    RefPtr<MediaSession> m_defaultMediaSession;
     1630#endif
     1631
     1632#if ENABLE(INDEXED_DATABASE)
     1633    RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
     1634#endif
     1635
     1636    Timer m_didAssociateFormControlsTimer;
     1637    Timer m_cookieCacheExpiryTimer;
     1638
     1639#if ENABLE(WEB_SOCKETS)
     1640    RefPtr<SocketProvider> m_socketProvider;
     1641#endif
     1642
     1643    String m_cachedDOMCookies;
     1644
     1645    HashSet<RefPtr<Element>> m_associatedFormControls;
     1646    unsigned m_disabledFieldsetElementsCount { 0 };
     1647
     1648    unsigned m_listenerTypes { 0 };
     1649    unsigned m_referencingNodeCount { 0 };
     1650    int m_loadEventDelayCount { 0 };
     1651    unsigned m_lastStyleUpdateSizeForTesting { 0 };
     1652
     1653    // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-destructive-writes-counter
     1654    unsigned m_ignoreDestructiveWriteCount { 0 };
     1655
     1656    // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
     1657    unsigned m_ignoreOpensDuringUnloadCount { 0 };
     1658
     1659    unsigned m_activeParserCount { 0 };
     1660    unsigned m_styleRecalcCount { 0 };
     1661
     1662    unsigned m_writeRecursionDepth { 0 };
     1663
     1664    InheritedBool m_designMode { inherit };
     1665    MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying };
     1666    PageCacheState m_pageCacheState { NotInPageCache };
     1667    ReferrerPolicy m_referrerPolicy { ReferrerPolicy::Default };
     1668    ReadyState m_readyState { Complete };
     1669    SelectionRestorationMode m_updateFocusAppearanceRestoresSelection { SelectionRestorationMode::SetDefault };
     1670
     1671    MutationObserverOptions m_mutationObserverTypes { 0 };
     1672
     1673    bool m_writeRecursionIsTooDeep { false };
     1674    bool m_wellFormed { false };
     1675    bool m_createRenderers { true };
     1676
     1677    bool m_hasNodesWithNonFinalStyle { false };
     1678    // But sometimes you need to ignore pending stylesheet count to
     1679    // force an immediate layout when requested by JS.
     1680    bool m_ignorePendingStylesheets { false };
     1681
     1682    bool m_hasElementUsingStyleBasedEditability { false };
     1683    bool m_focusNavigationStartingNodeIsRemoved { false };
     1684
     1685    bool m_printing { false };
     1686    bool m_paginatedForScreen { false };
     1687
     1688    DocumentCompatibilityMode m_compatibilityMode { DocumentCompatibilityMode::NoQuirksMode };
     1689    bool m_compatibilityModeLocked { false }; // This is cheaper than making setCompatibilityMode virtual.
    14961690
    14971691    // FIXME: Merge these 2 variables into an enum. Also, FrameLoader::m_didCallImplicitClose
     
    15021696    bool m_loadEventFinished { false };
    15031697
    1504     RefPtr<SerializedScriptValue> m_pendingStateObject;
    1505     MonotonicTime m_documentCreationTime;
    1506     bool m_overMinimumLayoutThreshold { false };
    1507    
    1508     std::unique_ptr<ScriptRunner> m_scriptRunner;
    1509     std::unique_ptr<ScriptModuleLoader> m_moduleLoader;
    1510 
    1511     Vector<RefPtr<HTMLScriptElement>> m_currentScriptStack;
    1512 
    1513 #if ENABLE(XSLT)
    1514     std::unique_ptr<TransformSource> m_transformSource;
    1515     RefPtr<Document> m_transformSourceDocument;
    1516 #endif
    1517 
    1518     String m_xmlEncoding;
    1519     String m_xmlVersion;
    1520     StandaloneStatus m_xmlStandalone { StandaloneUnspecified };
    1521     bool m_hasXMLDeclaration { false };
    1522 
    1523     String m_contentLanguage;
    1524 
    1525     RefPtr<TextResourceDecoder> m_decoder;
    1526 
    1527     InheritedBool m_designMode { inherit };
    1528 
    1529     HashSet<LiveNodeList*> m_listsInvalidatedAtDocument;
    1530     HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument;
    1531     unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes];
    1532 
    1533     RefPtr<XPathEvaluator> m_xpathEvaluator;
    1534 
    1535     std::unique_ptr<SVGDocumentExtensions> m_svgExtensions;
    1536 
    1537 #if ENABLE(DASHBOARD_SUPPORT)
    1538     Vector<AnnotatedRegionValue> m_annotatedRegions;
    1539     bool m_hasAnnotatedRegions { false };
    1540     bool m_annotatedRegionsDirty { false };
    1541 #endif
    1542 
    1543     HashMap<String, RefPtr<HTMLCanvasElement>> m_cssCanvasElements;
    1544 
    1545     bool m_createRenderers { true };
    1546     PageCacheState m_pageCacheState { NotInPageCache };
    1547 
    1548     HashSet<Element*> m_documentSuspensionCallbackElements;
    1549     HashSet<Element*> m_mediaVolumeCallbackElements;
    1550     HashSet<Element*> m_privateBrowsingStateChangedElements;
    1551 #if ENABLE(VIDEO_TRACK)
    1552     HashSet<Element*> m_captionPreferencesChangedElements;
    1553 #endif
    1554 
    1555 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
    1556     HashSet<HTMLMediaElement*> m_pageScaleFactorChangedElements;
    1557     HashSet<HTMLMediaElement*> m_userInterfaceLayoutDirectionChangedElements;
    1558 #endif
    1559 
    1560     HashSet<Element*> m_visibilityStateCallbackElements;
    1561 #if ENABLE(VIDEO)
    1562     HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements;
    1563 #endif
    1564 
    1565     HashMap<StringImpl*, Element*, ASCIICaseInsensitiveHash> m_elementsByAccessKey;
     1698    bool m_visuallyOrdered { false };
     1699    bool m_bParsing { false }; // FIXME: rename
     1700
     1701    bool m_pendingStyleRecalcShouldForce { false };
     1702    bool m_inStyleRecalc { false };
     1703    bool m_closeAfterStyleRecalc { false };
     1704    bool m_inRenderTreeUpdate { false };
     1705
     1706    bool m_gotoAnchorNeededAfterStylesheetsLoad { false };
     1707    bool m_isDNSPrefetchEnabled { false };
     1708    bool m_haveExplicitlyDisabledDNSPrefetch { false };
     1709    bool m_frameElementsShouldIgnoreScrolling { false };
     1710
    15661711    bool m_accessKeyMapValid { false };
    1567 
    1568     DocumentOrderedMap m_imagesByUsemap;
    1569 
    1570     std::unique_ptr<SelectorQueryCache> m_selectorQueryCache;
    1571 
    1572     DocumentClassFlags m_documentClasses;
    1573 
    15741712    bool m_isSynthesized { false };
    15751713    bool m_isNonRenderedPlaceholder { false };
     
    15771715    bool m_sawElementsInKnownNamespaces { false };
    15781716    bool m_isSrcdocDocument { false };
    1579 
    1580     RenderPtr<RenderView> m_renderView;
    1581     mutable DocumentEventQueue m_eventQueue;
    1582 
    1583     WeakPtrFactory<Document> m_weakFactory;
    1584 
    1585     HashSet<MediaCanStartListener*> m_mediaCanStartListeners;
    1586 
    1587 #if ENABLE(FULLSCREEN_API)
    1588     bool m_areKeysEnabledInFullScreen { false };
    1589     RefPtr<Element> m_fullScreenElement;
    1590     Vector<RefPtr<Element>> m_fullScreenElementStack;
    1591     RenderFullScreen* m_fullScreenRenderer { nullptr };
    1592     Timer m_fullScreenChangeDelayTimer;
    1593     Deque<RefPtr<Node>> m_fullScreenChangeEventTargetQueue;
    1594     Deque<RefPtr<Node>> m_fullScreenErrorEventTargetQueue;
    1595     bool m_isAnimatingFullScreen { false };
    1596     LayoutRect m_savedPlaceholderFrameRect;
    1597     std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle;
    1598 #endif
    1599 
    1600     HashSet<HTMLPictureElement*> m_viewportDependentPictures;
    1601 
    1602     int m_loadEventDelayCount { 0 };
    1603     Timer m_loadEventDelayTimer;
    1604 
    1605     ViewportArguments m_viewportArguments;
    1606 
    1607     ReferrerPolicy m_referrerPolicy;
    1608 
    1609 #if ENABLE(WEB_TIMING)
    1610     DocumentTiming m_documentTiming;
    1611 #endif
    1612 
    1613     RefPtr<MediaQueryMatcher> m_mediaQueryMatcher;
    1614     bool m_writeRecursionIsTooDeep { false };
    1615     unsigned m_writeRecursionDepth { 0 };
    1616    
    1617 #if ENABLE(TOUCH_EVENTS)
    1618     std::unique_ptr<EventTargetSet> m_touchEventTargets;
    1619 #endif
    1620     std::unique_ptr<EventTargetSet> m_wheelEventTargets;
    1621 
    1622     double m_lastHandledUserGestureTimestamp { 0 };
    1623 
    1624     void clearScriptedAnimationController();
    1625     RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
    1626 
    1627 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS)
    1628     std::unique_ptr<DeviceMotionClient> m_deviceMotionClient;
    1629     std::unique_ptr<DeviceMotionController> m_deviceMotionController;
    1630     std::unique_ptr<DeviceOrientationClient> m_deviceOrientationClient;
    1631     std::unique_ptr<DeviceOrientationController> m_deviceOrientationController;
    1632 #endif
    1633 
    1634 // FIXME: Find a better place for this functionality.
    1635 #if ENABLE(TELEPHONE_NUMBER_DETECTION)
    1636 public:
    1637 
    1638     // These functions provide a two-level setting:
    1639     //    - A user-settable wantsTelephoneNumberParsing (at the Page / WebView level)
    1640     //    - A read-only telephoneNumberParsingAllowed which is set by the
    1641     //      document if it has the appropriate meta tag.
    1642     //    - isTelephoneNumberParsingEnabled() == isTelephoneNumberParsingAllowed() && page()->settings()->isTelephoneNumberParsingEnabled()
    1643 
    1644     WEBCORE_EXPORT bool isTelephoneNumberParsingAllowed() const;
    1645     WEBCORE_EXPORT bool isTelephoneNumberParsingEnabled() const;
    1646 
    1647 private:
    1648     friend void setParserFeature(const String& key, const String& value, Document*, void* userData);
    1649     void setIsTelephoneNumberParsingAllowed(bool);
    1650 
    1651     bool m_isTelephoneNumberParsingAllowed { true };
    1652 #endif
    1653 
    1654     Timer m_pendingTasksTimer;
    1655     Vector<Task> m_pendingTasks;
    1656 
    1657 #if ENABLE(TEXT_AUTOSIZING)
    1658 public:
    1659     void addAutoSizedNode(Text&, float size);
    1660     void updateAutoSizedNodes();
    1661     void clearAutoSizedNodes();
    1662 
    1663 private:
    1664     using TextAutoSizingMap = HashMap<TextAutoSizingKey, std::unique_ptr<TextAutoSizingValue>, TextAutoSizingHash, TextAutoSizingTraits>;
    1665     TextAutoSizingMap m_textAutoSizedNodes;
    1666 #endif
    1667 
    1668     void platformSuspendOrStopActiveDOMObjects();
    1669 
    1670     bool m_scheduledTasksAreSuspended { false };
    1671    
    1672     bool m_visualUpdatesAllowed { true };
    1673     Timer m_visualUpdatesSuppressionTimer;
    1674 
    1675     RefPtr<NamedFlowCollection> m_namedFlows;
    1676 
    1677     void clearSharedObjectPool();
    1678     Timer m_sharedObjectPoolClearTimer;
    1679 
    1680     std::unique_ptr<DocumentSharedObjectPool> m_sharedObjectPool;
    1681 
    1682 #ifndef NDEBUG
    1683     bool m_didDispatchViewportPropertiesChanged { false };
    1684 #endif
    1685 
    1686     typedef HashMap<AtomicString, std::unique_ptr<Locale>> LocaleIdentifierToLocaleMap;
    1687     LocaleIdentifierToLocaleMap m_localeCache;
    1688 
    1689     RefPtr<Document> m_templateDocument;
    1690     Document* m_templateDocumentHost { nullptr }; // Manually managed weakref (backpointer from m_templateDocument).
    1691 
    1692     Ref<CSSFontSelector> m_fontSelector;
    1693 
    1694 #if ENABLE(WEB_REPLAY)
    1695     Ref<JSC::InputCursor> m_inputCursor;
    1696 #endif
    1697 
    1698     Timer m_didAssociateFormControlsTimer;
    1699     Timer m_cookieCacheExpiryTimer;
    1700     String m_cachedDOMCookies;
    1701     HashSet<RefPtr<Element>> m_associatedFormControls;
    1702     unsigned m_disabledFieldsetElementsCount { 0 };
    17031717
    17041718    bool m_hasInjectedPlugInsScript { false };
     
    17101724    bool m_isSuspended { false };
    17111725
    1712     HashSet<MediaProducer*> m_audioProducers;
    1713     MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying };
    1714 
    1715     HashSet<ShadowRoot*> m_inDocumentShadowRoots;
    1716 
    1717 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
    1718     typedef HashMap<uint64_t, WebCore::MediaPlaybackTargetClient*> TargetIdToClientMap;
    1719     TargetIdToClientMap m_idToClientMap;
    1720     typedef HashMap<WebCore::MediaPlaybackTargetClient*, uint64_t> TargetClientToIdMap;
    1721     TargetClientToIdMap m_clientToIDMap;
    1722 #endif
    1723 
    1724 #if ENABLE(MEDIA_SESSION)
    1725     RefPtr<MediaSession> m_defaultMediaSession;
    1726 #endif
     1726    bool m_scheduledTasksAreSuspended { false };
     1727    bool m_visualUpdatesAllowed { true };
     1728
    17271729    bool m_areDeviceMotionAndOrientationUpdatesSuspended { false };
     1730
     1731#if ENABLE(TELEPHONE_NUMBER_DETECTION)
     1732    bool m_isTelephoneNumberParsingAllowed { true };
     1733#endif
    17281734
    17291735#if ENABLE(MEDIA_STREAM)
     
    17311737#endif
    17321738
    1733 #if ENABLE(INDEXED_DATABASE)
    1734     RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
    1735 #endif
    1736 #if ENABLE(WEB_SOCKETS)
    1737     RefPtr<SocketProvider> m_socketProvider;
     1739#ifndef NDEBUG
     1740    bool m_didDispatchViewportPropertiesChanged { false };
    17381741#endif
    17391742
  • trunk/Source/WebCore/dom/ScriptExecutionContext.h

    r213519 r214203  
    241241    HashSet<ActiveDOMObject*> m_activeDOMObjects;
    242242
    243     int m_circularSequentialID { 0 };
    244243    HashMap<int, RefPtr<DOMTimer>> m_timeouts;
    245244
    246     bool m_inDispatchErrorEvent { false };
    247245    struct PendingException;
    248246    std::unique_ptr<Vector<std::unique_ptr<PendingException>>> m_pendingExceptions;
    249247
     248    ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects { static_cast<ActiveDOMObject::ReasonForSuspension>(-1) };
     249
     250    std::unique_ptr<PublicURLManager> m_publicURLManager;
     251
     252    RefPtr<DatabaseContext> m_databaseContext;
     253
     254    int m_circularSequentialID { 0 };
     255    int m_timerNestingLevel { 0 };
     256
    250257    bool m_activeDOMObjectsAreSuspended { false };
    251     ActiveDOMObject::ReasonForSuspension m_reasonForSuspendingActiveDOMObjects { static_cast<ActiveDOMObject::ReasonForSuspension>(-1) };
    252258    bool m_activeDOMObjectsAreStopped { false };
    253 
    254     std::unique_ptr<PublicURLManager> m_publicURLManager;
    255 
    256     RefPtr<DatabaseContext> m_databaseContext;
    257 
     259    bool m_inDispatchErrorEvent { false };
    258260    bool m_activeDOMObjectAdditionForbidden { false };
    259261    bool m_willProcessMessagePortMessagesSoon { false };
    260     int m_timerNestingLevel { 0 };
    261262
    262263#if !ASSERT_DISABLED
  • trunk/Source/WebCore/dom/SecurityContext.cpp

    r210859 r214203  
    3838
    3939SecurityContext::SecurityContext()
    40     : m_haveInitializedSecurityOrigin(false)
    41     , m_sandboxFlags(SandboxNone)
    4240{
    4341}
  • trunk/Source/WebCore/dom/SecurityContext.h

    r209577 r214203  
    4040enum SandboxFlag {
    4141    // See http://www.whatwg.org/specs/web-apps/current-work/#attr-iframe-sandbox for a list of the sandbox flags.
    42     SandboxNone = 0,
    43     SandboxNavigation = 1,
    44     SandboxPlugins = 1 << 1,
    45     SandboxOrigin = 1 << 2,
    46     SandboxForms = 1 << 3,
    47     SandboxScripts = 1 << 4,
    48     SandboxTopNavigation = 1 << 5,
    49     SandboxPopups = 1 << 6, // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12393
    50     SandboxAutomaticFeatures = 1 << 7,
    51     SandboxPointerLock = 1 << 8,
    52     SandboxAll = -1 // Mask with all bits set to 1.
     42    SandboxNone                 = 0,
     43    SandboxNavigation           = 1,
     44    SandboxPlugins              = 1 << 1,
     45    SandboxOrigin               = 1 << 2,
     46    SandboxForms                = 1 << 3,
     47    SandboxScripts              = 1 << 4,
     48    SandboxTopNavigation        = 1 << 5,
     49    SandboxPopups               = 1 << 6, // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=12393
     50    SandboxAutomaticFeatures    = 1 << 7,
     51    SandboxPointerLock          = 1 << 8,
     52    SandboxAll                  = -1 // Mask with all bits set to 1.
    5353};
    5454
     
    9595
    9696private:
    97     bool m_haveInitializedSecurityOrigin;
    98     SandboxFlags m_sandboxFlags;
    9997    RefPtr<SecurityOriginPolicy> m_securityOriginPolicy;
    10098    std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy;
     99    SandboxFlags m_sandboxFlags { SandboxNone };
     100    bool m_haveInitializedSecurityOrigin { false };
    101101    bool m_foundMixedContent { false };
    102102    bool m_geolocationAccessed { false };
  • trunk/Source/WebCore/page/SuspendableTimer.cpp

    r192848 r214203  
    3434SuspendableTimer::SuspendableTimer(ScriptExecutionContext& context)
    3535    : ActiveDOMObject(&context)
    36     , m_suspended(false)
    37     , m_savedNextFireInterval(0)
    38     , m_savedRepeatInterval(0)
    39     , m_savedIsActive(false)
    4036{
    4137}
  • trunk/Source/WebCore/page/SuspendableTimer.h

    r213519 r214203  
    8585    void resume() final;
    8686
    87     bool m_suspended;
     87    double m_savedNextFireInterval { 0 };
     88    double m_savedRepeatInterval { 0 };
    8889
    89     double m_savedNextFireInterval;
    90     double m_savedRepeatInterval;
    91     bool m_savedIsActive;
     90    bool m_suspended { false };
     91    bool m_savedIsActive { false };
    9292};
    9393
Note: See TracChangeset for help on using the changeset viewer.