Bug 185124

Summary: SubresourceLoader::didFail() should only log message if state is Initialized
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebCore Misc.Assignee: Woodrow Wang <wwang153>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, commit-queue, ews-watchlist, japhet, webkit-bug-importer, wilander, youennf
Priority: P2 Keywords: EasyFix, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Daniel Bates
Reported 2018-04-29 11:59:04 PDT
SubresourceLoader::didFail() has the followzing code: [[ void SubresourceLoader::didFail(const ResourceError& error) { if (m_frame && m_frame->document() && error.isAccessControl()) m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, error.localizedDescription()); #if USE(QUICK_LOOK) ... #endif if (m_state != Initialized) return; ASSERT(!reachedTerminalState()); LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string().latin1().data()); ... ]] The logic to log a console message should be moved after LOG() such that we only perform this logic if m_state != Initialized. Moreover, we do not need to null check m_frame once we move the code because it can never be null so long as we have not reached he terminal state.
Attachments
Patch (2.30 KB, patch)
2018-06-22 14:38 PDT, Woodrow Wang
no flags
Patch (2.65 KB, patch)
2018-06-22 17:32 PDT, Woodrow Wang
no flags
Patch (2.65 KB, patch)
2018-06-22 17:40 PDT, Woodrow Wang
no flags
Woodrow Wang
Comment 1 2018-06-22 14:38:21 PDT
Woodrow Wang
Comment 2 2018-06-22 17:32:44 PDT
Woodrow Wang
Comment 3 2018-06-22 17:40:40 PDT
WebKit Commit Bot
Comment 4 2018-06-22 18:22:10 PDT
Comment on attachment 343403 [details] Patch Clearing flags on attachment: 343403 Committed r233117: <https://trac.webkit.org/changeset/233117>
WebKit Commit Bot
Comment 5 2018-06-22 18:22:12 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2018-06-22 18:23:17 PDT
Note You need to log in before you can comment on or make changes to this bug.