Changeset 67223 in webkit


Ignore:
Timestamp:
Sep 10, 2010 12:54:10 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

After the MainResourceLoader hands the bytes for the main resource to
the DocumentLoader, the DocumentLoader hands the bytes to the
FrameLoaderClient. The FrameLoaderClient, in turn, returns the bytes
to WebCore. Prior to this patch, the FrameLoaderClient returned the
bytes to the FrameLoader. However, the FrameLoader was actually adding
any value.

In this patch, we change the FrameLoaderClient to return the bytes to
the DocumentLoader directly. In a future patch, we'll cut out the
FrameLoaderClient middleman and handle the bytes internally in the
DocumentLoader.

  • WebCore.exp.in:
  • loader/DocumentLoader.cpp: (WebCore::DocumentLoader::addData):
  • loader/DocumentLoader.h:
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::finishedLoadingDocument):
  • loader/FrameLoader.h:

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

Also, removed comment about wrong code in the Mac port.

  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::commitDocumentData):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebCoreSupport/FrameLoaderClientEfl.cpp: (WebCore::FrameLoaderClientEfl::committedLoad):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::committedLoad):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebCoreSupport/FrameLoaderClientHaiku.cpp: (WebCore::FrameLoaderClientHaiku::committedLoad):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

Previously, we were checking the document for null. However, Frame can
never have a null document, so this check is no longer needed.

  • WebView/WebFrame.mm: (-[WebFrame _addData:]):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::committedLoad):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebCoreSupport/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::receivedData):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebKitSupport/FrameLoaderClientWx.cpp: (WebCore::FrameLoaderClientWx::committedLoad):

2010-09-10 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Main resource bytes shouldn't bounce through FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=45496

Now return the bytes to the DocumentLoader.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::receivedData):
Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r67222 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        After the MainResourceLoader hands the bytes for the main resource to
     9        the DocumentLoader, the DocumentLoader hands the bytes to the
     10        FrameLoaderClient.  The FrameLoaderClient, in turn, returns the bytes
     11        to WebCore.  Prior to this patch, the FrameLoaderClient returned the
     12        bytes to the FrameLoader.  However, the FrameLoader was actually adding
     13        any value.
     14
     15        In this patch, we change the FrameLoaderClient to return the bytes to
     16        the DocumentLoader directly.  In a future patch, we'll cut out the
     17        FrameLoaderClient middleman and handle the bytes internally in the
     18        DocumentLoader.
     19
     20        * WebCore.exp.in:
     21        * loader/DocumentLoader.cpp:
     22        (WebCore::DocumentLoader::addData):
     23        * loader/DocumentLoader.h:
     24        * loader/FrameLoader.cpp:
     25        (WebCore::FrameLoader::finishedLoadingDocument):
     26        * loader/FrameLoader.h:
     27
    1282010-09-10  Oliver Hunt  <oliver@apple.com>
    229
  • trunk/WebCore/WebCore.exp.in

    r67219 r67223  
    171171__ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestEb
    172172__ZN7WebCore11FrameLoader6reloadEb
    173 __ZN7WebCore11FrameLoader7addDataEPKci
    174173__ZN7WebCore11Geolocation12setIsAllowedEb
    175174__ZN7WebCore11GeolocationD1Ev
     
    300299__ZN7WebCore14DocumentLoader22cancelMainResourceLoadERKNS_13ResourceErrorE
    301300__ZN7WebCore14DocumentLoader24removePlugInStreamLoaderEPNS_14ResourceLoaderE
     301__ZN7WebCore14DocumentLoader7addDataEPKci
    302302__ZN7WebCore14DocumentLoader7requestEv
    303303__ZN7WebCore14DocumentLoader8setFrameEPNS_5FrameE
  • trunk/WebCore/loader/DocumentLoader.cpp

    r67198 r67223  
    287287}
    288288
     289void DocumentLoader::addData(const char* bytes, int length)
     290{
     291    ASSERT(m_frame->document());
     292    ASSERT(m_frame->document()->parsing());
     293    // FIXME: DocumentWriter should move to be owned by DocumentLoader.
     294    frameLoader()->writer()->addData(bytes, length);
     295}
     296
    289297bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const
    290298{
  • trunk/WebCore/loader/DocumentLoader.h

    r65573 r67223  
    212212        void resetTiming() { m_documentLoadTiming = DocumentLoadTiming(); }
    213213
     214        void addData(const char* bytes, int length);
     215
    214216#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    215217        ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); }
  • trunk/WebCore/loader/FrameLoader.cpp

    r67198 r67223  
    10901090}
    10911091
    1092 void FrameLoader::addData(const char* bytes, int length)
    1093 {
    1094     ASSERT(m_workingURL.isEmpty());
    1095     ASSERT(m_frame->document());
    1096     ASSERT(m_frame->document()->parsing());
    1097     writer()->addData(bytes, length);
    1098 }
    1099 
    11001092#if ENABLE(WML)
    11011093static inline bool frameContainsWMLContent(Frame* frame)
     
    22562248    ASSERT(m_frame->document());
    22572249
    2258     addData(mainResource->data()->data(), mainResource->data()->size());
     2250    loader->addData(mainResource->data()->data(), mainResource->data()->size());
    22592251}
    22602252
  • trunk/WebCore/loader/FrameLoader.h

    r67198 r67223  
    262262    void resetMultipleFormSubmissionProtection();
    263263
    264     void addData(const char* bytes, int length);
    265 
    266264    void checkCallImplicitClose();
    267265
  • trunk/WebKit/chromium/ChangeLog

    r67188 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        Also, removed comment about wrong code in the Mac port.
     11
     12        * src/WebFrameImpl.cpp:
     13        (WebKit::WebFrameImpl::commitDocumentData):
     14
    1152010-09-08  Darin Adler  <darin@apple.com>
    216
  • trunk/WebKit/chromium/src/WebFrameImpl.cpp

    r67122 r67223  
    10131013}
    10141014
    1015 void WebFrameImpl::commitDocumentData(const char* data, size_t dataLen)
     1015// FIXME: This function should be moved into WebCore.
     1016void WebFrameImpl::commitDocumentData(const char* data, size_t length)
    10161017{
    10171018    DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
     
    10261027    }
    10271028    m_frame->loader()->writer()->setEncoding(encoding, userChosen);
    1028 
    1029     // NOTE: mac only does this if there is a document
    1030     m_frame->loader()->addData(data, dataLen);
     1029    m_frame->documentLoader()->addData(data, length);
    10311030}
    10321031
  • trunk/WebKit/efl/ChangeLog

    r67122 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebCoreSupport/FrameLoaderClientEfl.cpp:
     11        (WebCore::FrameLoaderClientEfl::committedLoad):
     12
    1132010-09-08  Darin Adler  <darin@apple.com>
    214
  • trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r66839 r67223  
    183183}
    184184
    185 
     185// FIXME: This function should be moved into WebCore.
    186186void FrameLoaderClientEfl::committedLoad(DocumentLoader* loader, const char* data, int length)
    187187{
     
    195195            m_firstData = false;
    196196        }
    197         fl->addData(data, length);
     197        fl->documentLoader()->addData(data, length);
    198198    }
    199199
  • trunk/WebKit/gtk/ChangeLog

    r67215 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebCoreSupport/FrameLoaderClientGtk.cpp:
     11        (WebKit::FrameLoaderClient::committedLoad):
     12
    1132010-09-10  Martin Robinson  <mrobinson@igalia.com>
    214
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r67211 r67223  
    246246}
    247247
    248 
     248// FIXME: This function should be moved into WebCore.
    249249void FrameLoaderClient::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
    250250{
     
    261261        frameLoader->writer()->setEncoding(encoding, userChosen);
    262262        if (data)
    263             frameLoader->addData(data, length);
     263            frameLoader->documentLoader()->addData(data, length);
    264264
    265265        Frame* coreFrame = loader->frame();
  • trunk/WebKit/haiku/ChangeLog

    r65021 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebCoreSupport/FrameLoaderClientHaiku.cpp:
     11        (WebCore::FrameLoaderClientHaiku::committedLoad):
     12
    1132010-08-06  Gavin Barraclough  <barraclough@apple.com>
    214
  • trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp

    r57927 r67223  
    505505}
    506506
     507// FIXME: This function should be moved into WebCore.
    507508void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
    508509{
     
    512513    FrameLoader* frameLoader = loader->frameLoader();
    513514    frameLoader->writer()->setEncoding(m_response.textEncodingName(), false);
    514     frameLoader->addData(data, length);
     515    frameLoader->documentLoader()->addData(data, length);
    515516}
    516517
  • trunk/WebKit/mac/ChangeLog

    r67130 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        Previously, we were checking the document for null.  However, Frame can
     11        never have a null document, so this check is no longer needed.
     12
     13        * WebView/WebFrame.mm:
     14        (-[WebFrame _addData:]):
     15
    1162010-09-09  John Therrell  <jtherrell@apple.com>
    217
  • trunk/WebKit/mac/WebView/WebFrame.mm

    r67122 r67223  
    491491{
    492492    Document* document = _private->coreFrame->document();
    493    
    494     // Document may be nil if the part is about to redirect
    495     // as a result of JS executing during load, i.e. one frame
    496     // changing another's location before the frame's document
    497     // has been created.
    498     if (!document)
    499         return;
    500493
    501494    document->setShouldCreateRenderers(_private->shouldCreateRenderers);
    502     _private->coreFrame->loader()->addData((const char *)[data bytes], [data length]);
     495    _private->coreFrame->loader()->documentLoader()->addData((const char *)[data bytes], [data length]);
    503496}
    504497
  • trunk/WebKit/qt/ChangeLog

    r67122 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebCoreSupport/FrameLoaderClientQt.cpp:
     11        (WebCore::FrameLoaderClientQt::committedLoad):
     12
    1132010-09-08  Darin Adler  <darin@apple.com>
    214
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r66794 r67223  
    790790}
    791791
     792// FIXME: This function should be moved into WebCore.
    792793void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
    793794{
     
    800801            m_firstData = false;
    801802        }
    802         fl->addData(data, length);
     803        fl->documentLoader()->addData(data, length);
    803804    }
    804805   
  • trunk/WebKit/win/ChangeLog

    r67125 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebCoreSupport/WebFrameLoaderClient.cpp:
     11        (WebFrameLoaderClient::receivedData):
     12
    1132010-09-09  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp

    r58154 r67223  
    513513}
    514514
     515// FIXME: This function should be moved into WebCore.
    515516void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
    516517{
     
    525526        encoding = textEncoding;
    526527    coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
    527 
    528     coreFrame->loader()->addData(data, length);
     528    coreFrame->loader()->documentLoader()->addData(data, length);
    529529}
    530530
  • trunk/WebKit/wx/ChangeLog

    r67122 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebKitSupport/FrameLoaderClientWx.cpp:
     11        (WebCore::FrameLoaderClientWx::committedLoad):
     12
    1132010-09-08  Darin Adler  <darin@apple.com>
    214
  • trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp

    r64229 r67223  
    613613}
    614614
     615// FIXME: This function should be moved into WebCore.
    615616void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
    616617{
     
    620621        FrameLoader* fl = loader->frameLoader();
    621622        fl->writer()->setEncoding(m_response.textEncodingName(), false);
    622         fl->addData(data, length);
     623        fl->documentLoader()->addData(data, length);
    623624    }
    624625   
  • trunk/WebKit2/ChangeLog

    r67202 r67223  
     12010-09-10  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Main resource bytes shouldn't bounce through FrameLoader
     6        https://bugs.webkit.org/show_bug.cgi?id=45496
     7
     8        Now return the bytes to the DocumentLoader.
     9
     10        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     11        (WebKit::WebFrameLoaderClient::receivedData):
     12
    1132010-09-10  Adam Roben  <aroben@apple.com>
    214
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r66894 r67223  
    621621}
    622622
     623// FIXME: This function should be moved into WebCore.
    623624void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
    624625{
     
    634635    coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
    635636   
    636     coreFrame->loader()->addData(data, length);
     637    coreFrame->loader()->documentLoader()->addData(data, length);
    637638}
    638639
Note: See TracChangeset for help on using the changeset viewer.