Changeset 67253 in webkit
- Timestamp:
- Sep 10, 2010 5:49:48 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r67252 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 There's a bunch of code that's copy/pasted (poorly) across all the 9 ports that really belongs in WebCore. This patch moves that logic into 10 DocumentLoader. This patch is a step on the path to having 11 DocumentLoader own DocumentWriter. 12 13 * WebCore.exp.in: 14 * loader/DocumentLoader.cpp: 15 (WebCore::DocumentLoader::commitData): 16 * loader/DocumentLoader.h: 17 * loader/FrameLoader.cpp: 18 (WebCore::FrameLoader::finishedLoadingDocument): 19 1 20 2010-09-10 Cosmin Truta <ctruta@chromium.org> 2 21 -
trunk/WebCore/WebCore.exp.in
r67238 r67253 291 291 __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE 292 292 __ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE 293 __ZN7WebCore14DocumentLoader10commitDataEPKci 293 294 __ZN7WebCore14DocumentLoader13attachToFrameEv 294 295 __ZN7WebCore14DocumentLoader15detachFromFrameEv … … 299 300 __ZN7WebCore14DocumentLoader22cancelMainResourceLoadERKNS_13ResourceErrorE 300 301 __ZN7WebCore14DocumentLoader24removePlugInStreamLoaderEPNS_14ResourceLoaderE 301 __ZN7WebCore14DocumentLoader7addDataEPKci302 302 __ZN7WebCore14DocumentLoader7requestEv 303 303 __ZN7WebCore14DocumentLoader8setFrameEPNS_5FrameE -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r67226 r67253 20628 20628 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 20629 20629 compatibilityVersion = "Xcode 2.4"; 20630 developmentRegion = English;20631 20630 hasScannedForEncodings = 1; 20632 20631 knownRegions = ( -
trunk/WebCore/loader/DocumentLoader.cpp
r67223 r67253 287 287 } 288 288 289 void DocumentLoader::addData(const char* bytes, int length) 290 { 291 ASSERT(m_frame->document()); 289 void DocumentLoader::commitData(const char* bytes, int length) 290 { 291 // Set the text encoding. This is safe to call multiple times. 292 bool userChosen = true; 293 String encoding = overrideEncoding(); 294 if (encoding.isNull()) { 295 userChosen = false; 296 encoding = response().textEncodingName(); 297 } 298 // FIXME: DocumentWriter should be owned by DocumentLoader. 299 m_frame->loader()->writer()->setEncoding(encoding, userChosen); 292 300 ASSERT(m_frame->document()->parsing()); 293 // FIXME: DocumentWriter should move to be owned by DocumentLoader. 294 frameLoader()->writer()->addData(bytes, length); 301 m_frame->loader()->writer()->addData(bytes, length); 295 302 } 296 303 -
trunk/WebCore/loader/DocumentLoader.h
r67223 r67253 212 212 void resetTiming() { m_documentLoadTiming = DocumentLoadTiming(); } 213 213 214 void addData(const char* bytes, int length); 214 // The WebKit layer calls this function when it's ready for the data to 215 // actually be added to the document. 216 void commitData(const char* bytes, int length); 215 217 216 218 #if ENABLE(OFFLINE_WEB_APPLICATIONS) -
trunk/WebCore/loader/FrameLoader.cpp
r67224 r67253 2227 2227 return; 2228 2228 2229 // FIXME: The remainder of this function should be in DocumentLoader. 2230 2229 2231 loader->addAllArchiveResources(archive.get()); 2230 2232 2231 2233 ArchiveResource* mainResource = archive->mainResource(); 2232 2234 loader->setParsedArchiveData(mainResource->data()); … … 2237 2239 didOpenURL(mainResource->url()); 2238 2240 2241 ASSERT(m_frame->document()); 2239 2242 String userChosenEncoding = documentLoader()->overrideEncoding(); 2240 2243 bool encodingIsUserChosen = !userChosenEncoding.isNull(); 2241 2244 writer()->setEncoding(encodingIsUserChosen ? userChosenEncoding : mainResource->textEncoding(), encodingIsUserChosen); 2242 2243 ASSERT(m_frame->document()); 2244 2245 loader->addData(mainResource->data()->data(), mainResource->data()->size()); 2245 writer()->addData(mainResource->data()->data(), mainResource->data()->size()); 2246 2246 } 2247 2247 -
trunk/WebKit/chromium/ChangeLog
r67250 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 * src/FrameLoaderClientImpl.cpp: 9 (WebKit::FrameLoaderClientImpl::committedLoad): 10 * src/WebFrameImpl.cpp: 11 (WebKit::WebFrameImpl::commitDocumentData): 12 1 13 2010-09-10 Tony Chang <tony@chromium.org> 2 14 -
trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp
r66794 r67253 1054 1054 // If we are sending data to MediaDocument, we should stop here 1055 1055 // and cancel the request. 1056 if (m_webFrame->frame()->document() 1057 && m_webFrame->frame()->document()->isMediaDocument()) 1056 if (m_webFrame->frame()->document()->isMediaDocument()) 1058 1057 loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response())); 1059 1058 -
trunk/WebKit/chromium/src/WebFrameImpl.cpp
r67250 r67253 1013 1013 } 1014 1014 1015 // FIXME: This function should be moved into WebCore.1016 1015 void WebFrameImpl::commitDocumentData(const char* data, size_t length) 1017 1016 { 1018 DocumentLoader* documentLoader = m_frame->loader()->documentLoader(); 1019 1020 // Set the text encoding. This calls begin() for us. It is safe to call 1021 // this multiple times (Mac does: page/mac/WebCoreFrameBridge.mm). 1022 bool userChosen = true; 1023 String encoding = documentLoader->overrideEncoding(); 1024 if (encoding.isNull()) { 1025 userChosen = false; 1026 encoding = documentLoader->response().textEncodingName(); 1027 } 1028 m_frame->loader()->writer()->setEncoding(encoding, userChosen); 1029 m_frame->loader()->documentLoader()->addData(data, length); 1017 m_frame->loader()->documentLoader()->commitData(data, length); 1030 1018 } 1031 1019 -
trunk/WebKit/efl/ChangeLog
r67223 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 This code didn't know that setEncoding could be called multiple times 9 safely. 10 11 * WebCoreSupport/FrameLoaderClientEfl.cpp: 12 (WebCore::FrameLoaderClientEfl::FrameLoaderClientEfl): 13 (WebCore::FrameLoaderClientEfl::committedLoad): 14 (WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse): 15 (WebCore::FrameLoaderClientEfl::finishedLoading): 16 (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading): 17 (WebCore::FrameLoaderClientEfl::setMainDocumentError): 18 * WebCoreSupport/FrameLoaderClientEfl.h: 19 1 20 2010-09-10 Adam Barth <abarth@webkit.org> 2 21 -
trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
r67223 r67253 68 68 : m_view(view) 69 69 , m_frame(0) 70 , m_firstData(false)71 70 , m_userAgent("") 72 71 , m_customUserAgent("") … … 183 182 } 184 183 185 // FIXME: This function should be moved into WebCore.186 184 void FrameLoaderClientEfl::committedLoad(DocumentLoader* loader, const char* data, int length) 187 185 { 188 if (!m_pluginView) { 189 if (!m_frame) 190 return; 191 192 FrameLoader* fl = loader->frameLoader(); 193 if (m_firstData) { 194 fl->writer()->setEncoding(m_response.textEncodingName(), false); 195 m_firstData = false; 196 } 197 fl->documentLoader()->addData(data, length); 198 } 186 if (!m_pluginView) 187 loader->commitData(data, length); 199 188 200 189 // We re-check here as the plugin can have been created … … 326 315 { 327 316 m_response = response; 328 m_firstData = true;329 317 } 330 318 … … 720 708 void FrameLoaderClientEfl::finishedLoading(DocumentLoader* loader) 721 709 { 722 if (!m_pluginView) { 723 if (m_firstData) { 724 FrameLoader* fl = loader->frameLoader(); 725 fl->writer()->setEncoding(m_response.textEncodingName(), false); 726 m_firstData = false; 727 } 728 } else { 729 m_pluginView->didFinishLoading(); 730 m_pluginView = 0; 731 m_hasSentResponseToPlugin = false; 732 } 710 if (!m_pluginView) 711 return; 712 m_pluginView->didFinishLoading(); 713 m_pluginView = 0; 714 m_hasSentResponseToPlugin = false; 733 715 } 734 716 … … 766 748 void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err) 767 749 { 768 if (!shouldFallBack(err)) 769 return; 770 771 if (m_firstData) { 772 FrameLoader* fl = loader->frameLoader(); 773 fl->writer()->setEncoding(m_response.textEncodingName(), false); 774 m_firstData = false; 775 } 776 750 notImplemented(); 777 751 } 778 752 … … 905 879 void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader* loader, const ResourceError& error) 906 880 { 907 if (!m_pluginView) { 908 if (m_firstData) { 909 loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false); 910 m_firstData = false; 911 } 912 } else { 913 m_pluginView->didFail(error); 914 m_pluginView = 0; 915 m_hasSentResponseToPlugin = false; 916 } 881 if (!m_pluginView) 882 return; 883 m_pluginView->didFail(error); 884 m_pluginView = 0; 885 m_hasSentResponseToPlugin = false; 917 886 } 918 887 -
trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
r66794 r67253 210 210 211 211 ResourceResponse m_response; 212 bool m_firstData;213 212 String m_userAgent; 214 213 String m_customUserAgent; -
trunk/WebKit/gtk/ChangeLog
r67223 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 * WebCoreSupport/FrameLoaderClientGtk.cpp: 9 (WebKit::FrameLoaderClient::committedLoad): 10 1 11 2010-09-10 Adam Barth <abarth@webkit.org> 2 12 -
trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r67223 r67253 246 246 } 247 247 248 // FIXME: This function should be moved into WebCore.249 248 void FrameLoaderClient::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) 250 249 { 251 250 if (!m_pluginView) { 252 251 ASSERT(loader->frame()); 253 // Setting the encoding on the frame loader is our way to get work done that is normally done 254 // when the first bit of data is received, even for the case of a document with no data (like about:blank). 255 String encoding = loader->overrideEncoding(); 256 bool userChosen = !encoding.isNull(); 257 if (!userChosen) 258 encoding = loader->response().textEncodingName(); 259 260 FrameLoader* frameLoader = loader->frameLoader(); 261 frameLoader->writer()->setEncoding(encoding, userChosen); 262 if (data) 263 frameLoader->documentLoader()->addData(data, length); 252 loader->commitData(data, length); 264 253 265 254 Frame* coreFrame = loader->frame(); 266 if (coreFrame && coreFrame->document() && coreFrame->document()->isMediaDocument())267 loader->cancelMainResourceLoad( frameLoader->client()->pluginWillHandleLoadError(loader->response()));255 if (coreFrame && coreFrame->document()->isMediaDocument()) 256 loader->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(loader->response())); 268 257 } 269 258 -
trunk/WebKit/haiku/ChangeLog
r67223 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 * WebCoreSupport/FrameLoaderClientHaiku.cpp: 9 (WebCore::FrameLoaderClientHaiku::committedLoad): 10 1 11 2010-09-10 Adam Barth <abarth@webkit.org> 2 12 -
trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
r67223 r67253 505 505 } 506 506 507 // FIXME: This function should be moved into WebCore.508 507 void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) 509 508 { 510 if (!m_frame) 511 return; 512 513 FrameLoader* frameLoader = loader->frameLoader(); 514 frameLoader->writer()->setEncoding(m_response.textEncodingName(), false); 515 frameLoader->documentLoader()->addData(data, length); 509 loader->commitData(data, length); 516 510 } 517 511 -
trunk/WebKit/mac/ChangeLog
r67238 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 This code is the most confused, but now should be a bit cleaner. 9 There's still a magical fake-setting for creating renderers that needs 10 to be cleaned up, but we can do that in a separate patch. 11 12 * WebView/WebFrame.mm: 13 (-[WebFrame _commitData:]): 14 * WebView/WebFrameInternal.h: 15 * WebView/WebHTMLRepresentation.mm: 16 (-[WebHTMLRepresentation receivedData:withDataSource:]): 17 (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): 18 1 19 2010-09-09 Darin Adler <darin@apple.com> 2 20 -
trunk/WebKit/mac/WebView/WebFrame.mm
r67238 r67253 488 488 } 489 489 490 - (void)_addData:(NSData *)data491 {492 Document* document = _private->coreFrame->document();493 494 document->setShouldCreateRenderers(_private->shouldCreateRenderers);495 _private->coreFrame->loader()->documentLoader()->addData((const char *)[data bytes], [data length]);496 }497 498 490 - (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString 499 491 { … … 936 928 } 937 929 938 - (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName 939 { 940 // Set the encoding. This only needs to be done once, but it's harmless to do it again later. 941 String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding(); 942 bool userChosen = !encoding.isNull(); 943 if (encoding.isNull()) 944 encoding = textEncodingName; 945 _private->coreFrame->loader()->writer()->setEncoding(encoding, userChosen); 946 [self _addData:data]; 930 - (void)_commitData:(NSData *)data 931 { 932 // FIXME: This really should be a setting. 933 Document* document = _private->coreFrame->document(); 934 document->setShouldCreateRenderers(_private->shouldCreateRenderers); 935 936 _private->coreFrame->loader()->documentLoader()->commitData((const char *)[data bytes], [data length]); 947 937 } 948 938 -
trunk/WebKit/mac/WebView/WebFrameInternal.h
r66323 r67253 163 163 - (BOOL)_canSaveAsWebArchive; 164 164 165 - (void)_ receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;165 - (void)_commitData:(NSData *)data; 166 166 167 167 @end -
trunk/WebKit/mac/WebView/WebHTMLRepresentation.mm
r67238 r67253 167 167 { 168 168 WebFrame *webFrame = [dataSource webFrame]; 169 if (webFrame) { 170 if (!_private->pluginView) 171 [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]]; 169 if (!webFrame) 170 return; 171 172 if (!_private->pluginView) 173 [webFrame _commitData:data]; 174 175 // If the document is a stand-alone media document, now is the right time to cancel the WebKit load 176 Frame* coreFrame = core(webFrame); 177 if (coreFrame->document()->isMediaDocument()) 178 coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response())); 179 180 if (_private->pluginView) { 181 if (!_private->hasSentResponseToPlugin) { 182 [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]]; 183 _private->hasSentResponseToPlugin = YES; 184 } 172 185 173 // If the document is a stand-alone media document, now is the right time to cancel the WebKit load 174 Frame* coreFrame = core(webFrame); 175 if (coreFrame->document() && coreFrame->document()->isMediaDocument()) 176 coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response())); 177 178 if (_private->pluginView) { 179 if (!_private->hasSentResponseToPlugin) { 180 [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]]; 181 _private->hasSentResponseToPlugin = YES; 182 } 183 184 [_private->manualLoader pluginView:_private->pluginView receivedData:data]; 185 } 186 [_private->manualLoader pluginView:_private->pluginView receivedData:data]; 186 187 } 187 188 } … … 196 197 - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource 197 198 { 198 WebFrame *frame = [dataSource webFrame];199 WebFrame* webFrame = [dataSource webFrame]; 199 200 200 201 if (_private->pluginView) { … … 203 204 } 204 205 205 if (frame) { 206 if (![self _isDisplayingWebArchive]) { 207 // Telling the frame we received some data and passing nil as the data is our 208 // way to get work done that is normally done when the first bit of data is 209 // received, even for the case of a document with no data (like about:blank). 210 [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]]; 211 } 212 213 WebView *webView = [frame webView]; 214 if ([webView isEditable]) 215 core(frame)->editor()->applyEditingStyleToBodyElement(); 216 } 206 if (!webFrame) 207 return; 208 209 if (![self _isDisplayingWebArchive]) { 210 // Telling the frame we received some data and passing nil as the data is our 211 // way to get work done that is normally done when the first bit of data is 212 // received, even for the case of a document with no data (like about:blank). 213 [webFrame _commitData:nil]; 214 } 215 216 WebView *webView = [webFrame webView]; 217 if ([webView isEditable]) 218 core(webFrame)->editor()->applyEditingStyleToBodyElement(); 217 219 } 218 220 -
trunk/WebKit/qt/ChangeLog
r67223 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 This code didn't know that setEncoding can be called multiple times. 9 10 * WebCoreSupport/FrameLoaderClientQt.cpp: 11 (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): 12 (WebCore::FrameLoaderClientQt::finishedLoading): 13 (WebCore::FrameLoaderClientQt::setMainDocumentError): 14 (WebCore::FrameLoaderClientQt::committedLoad): 15 (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): 16 (WebCore::FrameLoaderClientQt::dispatchDidFailLoading): 17 * WebCoreSupport/FrameLoaderClientQt.h: 18 1 19 2010-09-10 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r67223 r67253 190 190 : m_frame(0) 191 191 , m_webFrame(0) 192 , m_firstData(false)193 192 , m_pluginView(0) 194 193 , m_hasSentResponseToPlugin(false) … … 582 581 void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader) 583 582 { 584 if (!m_pluginView) { 585 if(m_firstData) { 586 FrameLoader *fl = loader->frameLoader(); 587 fl->writer()->setEncoding(m_response.textEncodingName(), false); 588 m_firstData = false; 589 } 590 } 591 else { 592 if (m_pluginView->isPluginView()) 593 m_pluginView->didFinishLoading(); 594 m_pluginView = 0; 595 m_hasSentResponseToPlugin = false; 596 } 583 if (!m_pluginView) 584 return; 585 if (m_pluginView->isPluginView()) 586 m_pluginView->didFinishLoading(); 587 m_pluginView = 0; 588 m_hasSentResponseToPlugin = false; 597 589 } 598 590 … … 777 769 void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError& error) 778 770 { 779 if (!m_pluginView) { 780 if (m_firstData) { 781 loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false); 782 m_firstData = false; 783 } 784 } else { 785 if (m_pluginView->isPluginView()) 786 m_pluginView->didFail(error); 787 m_pluginView = 0; 788 m_hasSentResponseToPlugin = false; 789 } 771 if (!m_pluginView) 772 return; 773 if (m_pluginView->isPluginView()) 774 m_pluginView->didFail(error); 775 m_pluginView = 0; 776 m_hasSentResponseToPlugin = false; 790 777 } 791 778 … … 793 780 void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) 794 781 { 795 if (!m_pluginView) { 796 if (!m_frame) 797 return; 798 FrameLoader *fl = loader->frameLoader(); 799 if (m_firstData) { 800 fl->writer()->setEncoding(m_response.textEncodingName(), false); 801 m_firstData = false; 802 } 803 fl->documentLoader()->addData(data, length); 804 } 782 if (!m_pluginView) 783 loader->commitData(data, length); 805 784 806 785 // We re-check here as the plugin can have been created … … 963 942 964 943 m_response = response; 965 m_firstData = true;966 944 if (dumpResourceLoadCallbacks) 967 945 printf("%s - didReceiveResponse %s\n", … … 993 971 (dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"), 994 972 qPrintable(drtDescriptionSuitableForTestResult(error))); 995 996 if (m_firstData) {997 FrameLoader *fl = loader->frameLoader();998 fl->writer()->setEncoding(m_response.textEncodingName(), false);999 m_firstData = false;1000 }1001 973 } 1002 974 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r66794 r67253 233 233 QWebFrame *m_webFrame; 234 234 ResourceResponse m_response; 235 bool m_firstData;236 235 237 236 // Plugin view to redirect data to -
trunk/WebKit/win/ChangeLog
r67238 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 * WebCoreSupport/WebFrameLoaderClient.cpp: 9 (WebFrameLoaderClient::committedLoad): 10 * WebCoreSupport/WebFrameLoaderClient.h: 11 1 12 2010-09-09 Darin Adler <darin@apple.com> 2 13 -
trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r67223 r67253 492 492 void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length) 493 493 { 494 // FIXME: This should probably go through the data source.495 const String& textEncoding = loader->response().textEncodingName();496 497 494 if (!m_manualLoader) 498 receivedData(data, length, textEncoding);495 loader->commitData(data, length); 499 496 500 497 if (!m_manualLoader) … … 511 508 } 512 509 m_manualLoader->didReceiveData(data, length); 513 }514 515 // FIXME: This function should be moved into WebCore.516 void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)517 {518 Frame* coreFrame = core(m_webFrame);519 if (!coreFrame)520 return;521 522 // Set the encoding. This only needs to be done once, but it's harmless to do it again later.523 String encoding = coreFrame->loader()->documentLoader()->overrideEncoding();524 bool userChosen = !encoding.isNull();525 if (encoding.isNull())526 encoding = textEncoding;527 coreFrame->loader()->writer()->setEncoding(encoding, userChosen);528 coreFrame->loader()->documentLoader()->addData(data, length);529 510 } 530 511 -
trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
r65021 r67253 127 127 private: 128 128 PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer); 129 void receivedData(const char*, int, const WTF::String&);130 129 WebHistory* webHistory() const; 131 130 -
trunk/WebKit/wx/ChangeLog
r67223 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 * WebKitSupport/FrameLoaderClientWx.cpp: 9 (WebCore::FrameLoaderClientWx::committedLoad): 10 1 11 2010-09-10 Adam Barth <abarth@webkit.org> 2 12 -
trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
r67223 r67253 618 618 if (!m_webFrame) 619 619 return; 620 if (!m_pluginView) { 621 FrameLoader* fl = loader->frameLoader(); 622 fl->writer()->setEncoding(m_response.textEncodingName(), false); 623 fl->documentLoader()->addData(data, length); 624 } 625 620 if (!m_pluginView) 621 loader->commitData(data, length); 622 626 623 // We re-check here as the plugin can have been created 627 624 if (m_pluginView) { -
trunk/WebKit2/ChangeLog
r67247 r67253 1 2010-09-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Darin Fisher. 4 5 Move code from WebKit-layer to DocumentLoader 6 https://bugs.webkit.org/show_bug.cgi?id=45569 7 8 This code looks copy/pasted from Mac. It's unclear whether whether all 9 the complexity is needed here, but I don't have a good way to find out. 10 11 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 12 (WebKit::WebFrameLoaderClient::committedLoad): 13 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 14 1 15 2010-09-10 Anders Carlsson <andersca@apple.com> 2 16 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r67223 r67253 600 600 void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length) 601 601 { 602 const String& textEncoding = loader->response().textEncodingName();603 604 602 if (!m_pluginView) 605 receivedData(data, length, textEncoding);606 607 // Calling receivedData did not create the plug-in view.603 loader->commitData(data, length); 604 605 // Calling commitData did not create the plug-in view. 608 606 if (!m_pluginView) 609 607 return; … … 621 619 } 622 620 623 // FIXME: This function should be moved into WebCore.624 void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)625 {626 Frame* coreFrame = m_frame->coreFrame();627 if (!coreFrame)628 return;629 630 // Set the encoding. This only needs to be done once, but it's harmless to do it again later.631 String encoding = coreFrame->loader()->documentLoader()->overrideEncoding();632 bool userChosen = !encoding.isNull();633 if (encoding.isNull())634 encoding = textEncoding;635 coreFrame->loader()->writer()->setEncoding(encoding, userChosen);636 637 coreFrame->loader()->documentLoader()->addData(data, length);638 }639 640 621 void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader) 641 622 { -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r66794 r67253 204 204 virtual bool shouldUsePluginDocument(const WTF::String& /*mimeType*/) const; 205 205 206 void receivedData(const char* data, int length, const WTF::String& textEncoding);207 208 206 virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext(); 209 207
Note: See TracChangeset
for help on using the changeset viewer.