Title: [229046] trunk/Source/WebCore
Revision
229046
Author
[email protected]
Date
2018-02-26 16:20:01 -0800 (Mon, 26 Feb 2018)

Log Message

Add some more release logging related to DocumentWriter::addData crash
https://bugs.webkit.org/show_bug.cgi?id=183141

Patch by Youenn Fablet <[email protected]> on 2018-02-26
Reviewed by Chris Dumez.

No change of behavior.
Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/DocumentWriter.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (229045 => 229046)


--- trunk/Source/WebCore/ChangeLog	2018-02-27 00:04:06 UTC (rev 229045)
+++ trunk/Source/WebCore/ChangeLog	2018-02-27 00:20:01 UTC (rev 229046)
@@ -1,3 +1,19 @@
+2018-02-26  Youenn Fablet  <[email protected]>
+
+        Add some more release logging related to DocumentWriter::addData crash
+        https://bugs.webkit.org/show_bug.cgi?id=183141
+
+        Reviewed by Chris Dumez.
+
+        No change of behavior.
+        Add some additional release logging to verify whether DocumentWriter::begin was called and exited before updating its state.
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::commitData):
+        * loader/DocumentWriter.cpp:
+        (WebCore::DocumentWriter::begin):
+        * loader/DocumentWriter.h:
+
 2018-02-26  Antoine Quint  <[email protected]>
 
         [Web Animations] Implement the procedure to set the start time

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (229045 => 229046)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-02-27 00:04:06 UTC (rev 229045)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-02-27 00:20:01 UTC (rev 229046)
@@ -944,7 +944,7 @@
 {
     if (!m_gotFirstByte) {
         m_gotFirstByte = true;
-        m_writer.begin(documentURL(), false);
+        bool hasBegun = m_writer.begin(documentURL(), false);
         m_writer.setDocumentWasLoadedAsPartOfNavigation();
 
         if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubstituteDataWasValid) {
@@ -1002,6 +1002,8 @@
         }
 
         m_writer.setEncoding(encoding, userChosen);
+
+        RELEASE_ASSERT(hasBegun);
     }
 
 #if ENABLE(CONTENT_EXTENSIONS)

Modified: trunk/Source/WebCore/loader/DocumentWriter.cpp (229045 => 229046)


--- trunk/Source/WebCore/loader/DocumentWriter.cpp	2018-02-27 00:04:06 UTC (rev 229045)
+++ trunk/Source/WebCore/loader/DocumentWriter.cpp	2018-02-27 00:20:01 UTC (rev 229046)
@@ -109,9 +109,9 @@
         m_encoding = String();
 }
 
-void DocumentWriter::begin()
+bool DocumentWriter::begin()
 {
-    begin(URL());
+    return begin(URL());
 }
 
 Ref<Document> DocumentWriter::createDocument(const URL& url)
@@ -127,7 +127,7 @@
     return DOMImplementation::createDocument(m_mimeType, m_frame, url);
 }
 
-void DocumentWriter::begin(const URL& urlReference, bool dispatch, Document* ownerDocument)
+bool DocumentWriter::begin(const URL& urlReference, bool dispatch, Document* ownerDocument)
 {
     // We grab a local copy of the URL because it's easy for callers to supply
     // a URL that will be deallocated during the execution of this function.
@@ -165,7 +165,7 @@
     // m_frame->loader().clear() might fire unload event which could remove the view of the document.
     // Bail out if document has no view.
     if (!document->view())
-        return;
+        return false;
 
     if (!shouldReuseDefaultView)
         m_frame->script().updatePlatformScriptObjects();
@@ -196,6 +196,7 @@
         m_frame->view()->setContentsSize(IntSize());
 
     m_state = StartedWritingState;
+    return true;
 }
 
 TextResourceDecoder* DocumentWriter::createDecoderIfNeeded()

Modified: trunk/Source/WebCore/loader/DocumentWriter.h (229045 => 229046)


--- trunk/Source/WebCore/loader/DocumentWriter.h	2018-02-27 00:04:06 UTC (rev 229045)
+++ trunk/Source/WebCore/loader/DocumentWriter.h	2018-02-27 00:20:01 UTC (rev 229046)
@@ -48,8 +48,8 @@
     // and always contains the result of evaluating a _javascript_: url.
     void replaceDocument(const String&, Document* ownerDocument);
 
-    void begin();
-    void begin(const URL&, bool dispatchWindowObjectAvailable = true, Document* ownerDocument = 0);
+    bool begin();
+    bool begin(const URL&, bool dispatchWindowObjectAvailable = true, Document* ownerDocument = nullptr);
     void addData(const char* bytes, size_t length);
     WEBCORE_EXPORT void end();
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to