Changeset 246382 in webkit


Ignore:
Timestamp:
Jun 12, 2019 3:36:31 PM (5 years ago)
Author:
sihui_liu@apple.com
Message:

Add assertions to help debug crash at WebKit::HistoryEntryDataEncoder::operator<<
https://bugs.webkit.org/show_bug.cgi?id=198766

Reviewed by Geoffrey Garen.

  • Shared/SessionState.h:

(WebKit::FrameState::~FrameState):

  • UIProcess/API/C/WKPage.cpp:

(WKPageCopySessionState):

  • UIProcess/mac/LegacySessionStateCoding.cpp:

(WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
(WebKit::encodeFrameStateNode):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246374 r246382  
     12019-06-12  Sihui Liu  <sihui_liu@apple.com>
     2
     3        Add assertions to help debug crash at WebKit::HistoryEntryDataEncoder::operator<<
     4        https://bugs.webkit.org/show_bug.cgi?id=198766
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * Shared/SessionState.h:
     9        (WebKit::FrameState::~FrameState):
     10        * UIProcess/API/C/WKPage.cpp:
     11        (WKPageCopySessionState):
     12        * UIProcess/mac/LegacySessionStateCoding.cpp:
     13        (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
     14        (WebKit::encodeFrameStateNode):
     15
    1162019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
    217
  • trunk/Source/WebKit/Shared/SessionState.h

    r241224 r246382  
    112112
    113113    Vector<FrameState> children;
     114
     115    // This is only used to help debug <rdar://problem/48634553>.
     116    bool isDestructed { false };
     117    ~FrameState() { isDestructed = true; }
    114118};
    115119
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r244614 r246382  
    481481    });
    482482
     483    auto data = encodeLegacySessionState(sessionState);
    483484    if (shouldReturnData)
    484         return toAPI(encodeLegacySessionState(sessionState).leakRef());
     485        return toAPI(data.leakRef());
    485486
    486487    return toAPI(&API::SessionState::create(WTFMove(sessionState)).leakRef());
  • trunk/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp

    r239461 r246382  
    209209    void encodeFixedLengthData(const uint8_t* data, size_t size, unsigned alignment)
    210210    {
     211        RELEASE_ASSERT(data || !size);
    211212        ASSERT(!(reinterpret_cast<uintptr_t>(data) % alignment));
    212213
     
    319320    encoder << static_cast<uint64_t>(frameState.children.size());
    320321
     322    RELEASE_ASSERT(!frameState.isDestructed);
    321323    for (const auto& childFrameState : frameState.children) {
     324        RELEASE_ASSERT(!childFrameState.isDestructed);
    322325        encoder << childFrameState.originalURLString;
    323326        encoder << childFrameState.urlString;
Note: See TracChangeset for help on using the changeset viewer.