[Content Filtering] Avoid creating a ContentFilter when loading the empty document
Created attachment 266174 [details] Patch
Comment on attachment 266174 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266174&action=review > Source/WebCore/loader/DocumentLoader.cpp:1421 > + m_contentFilter = !m_originalSubstituteDataWasValid ? ContentFilter::createIfEnabled(*this) : nullptr; I do not have easy access to search the repository at the moment. Can we write a test/do we have a test that verifies that we enable content filtering for the main resource when loaded from app cache? If not, then I suggest that we write one to ensure that we do not regress this behavior. You may be able to take inspiration from test <http://trac.webkit.org/browser/trunk/LayoutTests/http/tests/appcache/local-content.html> on how to load the main resource from app cache.
(In reply to comment #2) > Comment on attachment 266174 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=266174&action=review > > > Source/WebCore/loader/DocumentLoader.cpp:1421 > > + m_contentFilter = !m_originalSubstituteDataWasValid ? ContentFilter::createIfEnabled(*this) : nullptr; > > I do not have easy access to search the repository at the moment. Can we > write a test/do we have a test that verifies that we enable content > filtering for the main resource when loaded from app cache? If not, then I > suggest that we write one to ensure that we do not regress this behavior. > You may be able to take inspiration from test > <http://trac.webkit.org/browser/trunk/LayoutTests/http/tests/appcache/local- > content.html> on how to load the main resource from app cache. This should be covered by http://trac.webkit.org/browser/trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html. Thanks for the review!
Committed r192797: <http://trac.webkit.org/changeset/192797>