[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 13:19:08 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7736bd47d777a6e90f2d16d43a55adae4885e10c
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Sep 11 00:49:48 2010 +0000
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::committedLoad):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::commitDocumentData):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
This code didn't know that setEncoding can be called multiple times.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
(WebCore::FrameLoaderClientQt::finishedLoading):
(WebCore::FrameLoaderClientQt::setMainDocumentError):
(WebCore::FrameLoaderClientQt::committedLoad):
(WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
(WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
* WebCoreSupport/FrameLoaderClientQt.h:
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::committedLoad):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::committedLoad):
* WebCoreSupport/WebFrameLoaderClient.h:
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::committedLoad):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
This code is the most confused, but now should be a bit cleaner.
There's still a magical fake-setting for creating renderers that needs
to be cleaned up, but we can do that in a separate patch.
* WebView/WebFrame.mm:
(-[WebFrame _commitData:]):
* WebView/WebFrameInternal.h:
* WebView/WebHTMLRepresentation.mm:
(-[WebHTMLRepresentation receivedData:withDataSource:]):
(-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
* WebCoreSupport/FrameLoaderClientHaiku.cpp:
(WebCore::FrameLoaderClientHaiku::committedLoad):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
This code didn't know that setEncoding could be called multiple times
safely.
* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::FrameLoaderClientEfl):
(WebCore::FrameLoaderClientEfl::committedLoad):
(WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse):
(WebCore::FrameLoaderClientEfl::finishedLoading):
(WebCore::FrameLoaderClientEfl::dispatchDidFailLoading):
(WebCore::FrameLoaderClientEfl::setMainDocumentError):
* WebCoreSupport/FrameLoaderClientEfl.h:
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
There's a bunch of code that's copy/pasted (poorly) across all the
ports that really belongs in WebCore. This patch moves that logic into
DocumentLoader. This patch is a step on the path to having
DocumentLoader own DocumentWriter.
* WebCore.exp.in:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::finishedLoadingDocument):
2010-09-10 Adam Barth <abarth at webkit.org>
Reviewed by Darin Fisher.
Move code from WebKit-layer to DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=45569
This code looks copy/pasted from Mac. It's unclear whether whether all
the complexity is needed here, but I don't have a good way to find out.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::committedLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 57d3bfd..8bf8703 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ There's a bunch of code that's copy/pasted (poorly) across all the
+ ports that really belongs in WebCore. This patch moves that logic into
+ DocumentLoader. This patch is a step on the path to having
+ DocumentLoader own DocumentWriter.
+
+ * WebCore.exp.in:
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::commitData):
+ * loader/DocumentLoader.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::finishedLoadingDocument):
+
2010-09-10 Cosmin Truta <ctruta at chromium.org>
Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 3a808fc..f9ce98f 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -290,6 +290,7 @@ __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
__ZN7WebCore14CachedResource9addClientEPNS_20CachedResourceClientE
+__ZN7WebCore14DocumentLoader10commitDataEPKci
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore14DocumentLoader18addArchiveResourceEN3WTF10PassRefPtrINS_15ArchiveResourceEEE
@@ -298,7 +299,6 @@ __ZN7WebCore14DocumentLoader21addPlugInStreamLoaderEPNS_14ResourceLoaderE
__ZN7WebCore14DocumentLoader22addAllArchiveResourcesEPNS_7ArchiveE
__ZN7WebCore14DocumentLoader22cancelMainResourceLoadERKNS_13ResourceErrorE
__ZN7WebCore14DocumentLoader24removePlugInStreamLoaderEPNS_14ResourceLoaderE
-__ZN7WebCore14DocumentLoader7addDataEPKci
__ZN7WebCore14DocumentLoader7requestEv
__ZN7WebCore14DocumentLoader8setFrameEPNS_5FrameE
__ZN7WebCore14DocumentLoader8setTitleERKN3WTF6StringE
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index d580b5f..659c2b9 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -20627,7 +20627,6 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index a58263e..b88c89e 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -286,12 +286,19 @@ void DocumentLoader::commitLoad(const char* data, int length)
frameLoader->client()->committedLoad(this, data, length);
}
-void DocumentLoader::addData(const char* bytes, int length)
-{
- ASSERT(m_frame->document());
+void DocumentLoader::commitData(const char* bytes, int length)
+{
+ // Set the text encoding. This is safe to call multiple times.
+ bool userChosen = true;
+ String encoding = overrideEncoding();
+ if (encoding.isNull()) {
+ userChosen = false;
+ encoding = response().textEncodingName();
+ }
+ // FIXME: DocumentWriter should be owned by DocumentLoader.
+ m_frame->loader()->writer()->setEncoding(encoding, userChosen);
ASSERT(m_frame->document()->parsing());
- // FIXME: DocumentWriter should move to be owned by DocumentLoader.
- frameLoader()->writer()->addData(bytes, length);
+ m_frame->loader()->writer()->addData(bytes, length);
}
bool DocumentLoader::doesProgressiveLoad(const String& MIMEType) const
diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h
index a7b8b41..50879b7 100644
--- a/WebCore/loader/DocumentLoader.h
+++ b/WebCore/loader/DocumentLoader.h
@@ -211,7 +211,9 @@ namespace WebCore {
DocumentLoadTiming* timing() { return &m_documentLoadTiming; }
void resetTiming() { m_documentLoadTiming = DocumentLoadTiming(); }
- void addData(const char* bytes, int length);
+ // The WebKit layer calls this function when it's ready for the data to
+ // actually be added to the document.
+ void commitData(const char* bytes, int length);
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
ApplicationCacheHost* applicationCacheHost() const { return m_applicationCacheHost.get(); }
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index fdc432d..2e3ae9d 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -2226,8 +2226,10 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
if (!archive)
return;
- loader->addAllArchiveResources(archive.get());
+ // FIXME: The remainder of this function should be in DocumentLoader.
+ loader->addAllArchiveResources(archive.get());
+
ArchiveResource* mainResource = archive->mainResource();
loader->setParsedArchiveData(mainResource->data());
@@ -2236,13 +2238,11 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
closeURL();
didOpenURL(mainResource->url());
+ ASSERT(m_frame->document());
String userChosenEncoding = documentLoader()->overrideEncoding();
bool encodingIsUserChosen = !userChosenEncoding.isNull();
writer()->setEncoding(encodingIsUserChosen ? userChosenEncoding : mainResource->textEncoding(), encodingIsUserChosen);
-
- ASSERT(m_frame->document());
-
- loader->addData(mainResource->data()->data(), mainResource->data()->size());
+ writer()->addData(mainResource->data()->data(), mainResource->data()->size());
}
bool FrameLoader::isReplacing() const
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 8176a84..3b3a5cd 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::committedLoad):
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::commitDocumentData):
+
2010-09-10 Tony Chang <tony at chromium.org>
Unreviewed, fix chromium compile after r67238.
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index ea668c7..641492c 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -1053,8 +1053,7 @@ void FrameLoaderClientImpl::committedLoad(DocumentLoader* loader, const char* da
// If we are sending data to MediaDocument, we should stop here
// and cancel the request.
- if (m_webFrame->frame()->document()
- && m_webFrame->frame()->document()->isMediaDocument())
+ if (m_webFrame->frame()->document()->isMediaDocument())
loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response()));
// The plugin widget could have been created in the m_webFrame->DidReceiveData
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 50bf2e9..af2f7b6 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1012,21 +1012,9 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request)
0, 0, request.toMutableResourceRequest(), response);
}
-// FIXME: This function should be moved into WebCore.
void WebFrameImpl::commitDocumentData(const char* data, size_t length)
{
- DocumentLoader* documentLoader = m_frame->loader()->documentLoader();
-
- // Set the text encoding. This calls begin() for us. It is safe to call
- // this multiple times (Mac does: page/mac/WebCoreFrameBridge.mm).
- bool userChosen = true;
- String encoding = documentLoader->overrideEncoding();
- if (encoding.isNull()) {
- userChosen = false;
- encoding = documentLoader->response().textEncodingName();
- }
- m_frame->loader()->writer()->setEncoding(encoding, userChosen);
- m_frame->loader()->documentLoader()->addData(data, length);
+ m_frame->loader()->documentLoader()->commitData(data, length);
}
unsigned WebFrameImpl::unloadListenerCount() const
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index e492a5b..978c91a 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,5 +1,24 @@
2010-09-10 Adam Barth <abarth at webkit.org>
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code didn't know that setEncoding could be called multiple times
+ safely.
+
+ * WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::FrameLoaderClientEfl):
+ (WebCore::FrameLoaderClientEfl::committedLoad):
+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientEfl::finishedLoading):
+ (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading):
+ (WebCore::FrameLoaderClientEfl::setMainDocumentError):
+ * WebCoreSupport/FrameLoaderClientEfl.h:
+
+2010-09-10 Adam Barth <abarth at webkit.org>
+
Reviewed by Eric Seidel.
Main resource bytes shouldn't bounce through FrameLoader
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index f0aaa5f..9409776 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -67,7 +67,6 @@ namespace WebCore {
FrameLoaderClientEfl::FrameLoaderClientEfl(Evas_Object *view)
: m_view(view)
, m_frame(0)
- , m_firstData(false)
, m_userAgent("")
, m_customUserAgent("")
, m_pluginView(0)
@@ -182,20 +181,10 @@ void FrameLoaderClientEfl::dispatchWillSubmitForm(FramePolicyFunction function,
callPolicyFunction(function, PolicyUse);
}
-// FIXME: This function should be moved into WebCore.
void FrameLoaderClientEfl::committedLoad(DocumentLoader* loader, const char* data, int length)
{
- if (!m_pluginView) {
- if (!m_frame)
- return;
-
- FrameLoader* fl = loader->frameLoader();
- if (m_firstData) {
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- fl->documentLoader()->addData(data, length);
- }
+ if (!m_pluginView)
+ loader->commitData(data, length);
// We re-check here as the plugin can have been created
if (m_pluginView) {
@@ -325,7 +314,6 @@ void FrameLoaderClientEfl::frameLoaderDestroyed()
void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse& response)
{
m_response = response;
- m_firstData = true;
}
void FrameLoaderClientEfl::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& MIMEType, const ResourceRequest&)
@@ -719,17 +707,11 @@ String FrameLoaderClientEfl::generatedMIMETypeForURLScheme(const String&) const
void FrameLoaderClientEfl::finishedLoading(DocumentLoader* loader)
{
- if (!m_pluginView) {
- if (m_firstData) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- m_pluginView->didFinishLoading();
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
@@ -765,15 +747,7 @@ void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned lo
void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err)
{
- if (!shouldFallBack(err))
- return;
-
- if (m_firstData) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
-
+ notImplemented();
}
bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)
@@ -904,16 +878,11 @@ void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&)
void FrameLoaderClientEfl::setMainDocumentError(DocumentLoader* loader, const ResourceError& error)
{
- if (!m_pluginView) {
- if (m_firstData) {
- loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- m_pluginView->didFail(error);
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
void FrameLoaderClientEfl::startDownload(const ResourceRequest&)
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
index bd105cd..6b66ee0 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
@@ -209,7 +209,6 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
Evas_Object *m_frame;
ResourceResponse m_response;
- bool m_firstData;
String m_userAgent;
String m_customUserAgent;
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 036c5ce..82cd485 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,5 +1,15 @@
2010-09-10 Adam Barth <abarth at webkit.org>
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::committedLoad):
+
+2010-09-10 Adam Barth <abarth at webkit.org>
+
Reviewed by Eric Seidel.
Main resource bytes shouldn't bounce through FrameLoader
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 5974396..156c0d0 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -245,26 +245,15 @@ void FrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction policyFunctio
(core(m_frame)->loader()->policyChecker()->*policyFunction)(PolicyUse);
}
-// FIXME: This function should be moved into WebCore.
void FrameLoaderClient::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_pluginView) {
ASSERT(loader->frame());
- // Setting the encoding on the frame loader is our way to get work done that is normally done
- // when the first bit of data is received, even for the case of a document with no data (like about:blank).
- String encoding = loader->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (!userChosen)
- encoding = loader->response().textEncodingName();
-
- FrameLoader* frameLoader = loader->frameLoader();
- frameLoader->writer()->setEncoding(encoding, userChosen);
- if (data)
- frameLoader->documentLoader()->addData(data, length);
+ loader->commitData(data, length);
Frame* coreFrame = loader->frame();
- if (coreFrame && coreFrame->document() && coreFrame->document()->isMediaDocument())
- loader->cancelMainResourceLoad(frameLoader->client()->pluginWillHandleLoadError(loader->response()));
+ if (coreFrame && coreFrame->document()->isMediaDocument())
+ loader->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(loader->response()));
}
if (m_pluginView) {
diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog
index dcb0f14..129eb86 100644
--- a/WebKit/haiku/ChangeLog
+++ b/WebKit/haiku/ChangeLog
@@ -1,5 +1,15 @@
2010-09-10 Adam Barth <abarth at webkit.org>
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/FrameLoaderClientHaiku.cpp:
+ (WebCore::FrameLoaderClientHaiku::committedLoad):
+
+2010-09-10 Adam Barth <abarth at webkit.org>
+
Reviewed by Eric Seidel.
Main resource bytes shouldn't bounce through FrameLoader
diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
index f3d1f87..d6f708f 100644
--- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
+++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
@@ -504,15 +504,9 @@ void FrameLoaderClientHaiku::setMainDocumentError(WebCore::DocumentLoader*, cons
notImplemented();
}
-// FIXME: This function should be moved into WebCore.
void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
- if (!m_frame)
- return;
-
- FrameLoader* frameLoader = loader->frameLoader();
- frameLoader->writer()->setEncoding(m_response.textEncodingName(), false);
- frameLoader->documentLoader()->addData(data, length);
+ loader->commitData(data, length);
}
WebCore::ResourceError FrameLoaderClientHaiku::cancelledError(const WebCore::ResourceRequest& request)
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index c786a02..1677027 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code is the most confused, but now should be a bit cleaner.
+ There's still a magical fake-setting for creating renderers that needs
+ to be cleaned up, but we can do that in a separate patch.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _commitData:]):
+ * WebView/WebFrameInternal.h:
+ * WebView/WebHTMLRepresentation.mm:
+ (-[WebHTMLRepresentation receivedData:withDataSource:]):
+ (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+
2010-09-09 Darin Adler <darin at apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 6aa8f00..2995aef 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -487,14 +487,6 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return dataSource(_private->coreFrame->loader()->documentLoader());
}
-- (void)_addData:(NSData *)data
-{
- Document* document = _private->coreFrame->document();
-
- document->setShouldCreateRenderers(_private->shouldCreateRenderers);
- _private->coreFrame->loader()->documentLoader()->addData((const char *)[data bytes], [data length]);
-}
-
- (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString
{
return _private->coreFrame->documentTypeString() + markupString;
@@ -935,15 +927,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return [self _canProvideDocumentSource];
}
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
+- (void)_commitData:(NSData *)data
{
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncodingName;
- _private->coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
- [self _addData:data];
+ // FIXME: This really should be a setting.
+ Document* document = _private->coreFrame->document();
+ document->setShouldCreateRenderers(_private->shouldCreateRenderers);
+
+ _private->coreFrame->loader()->documentLoader()->commitData((const char *)[data bytes], [data length]);
}
@end
diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h
index dc3de21..8cdc272 100644
--- a/WebKit/mac/WebView/WebFrameInternal.h
+++ b/WebKit/mac/WebView/WebFrameInternal.h
@@ -162,7 +162,7 @@ WebView *getWebView(WebFrame *webFrame);
- (BOOL)_canProvideDocumentSource;
- (BOOL)_canSaveAsWebArchive;
-- (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
+- (void)_commitData:(NSData *)data;
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 2c37734..307617e 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -166,23 +166,24 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
WebFrame *webFrame = [dataSource webFrame];
- if (webFrame) {
- if (!_private->pluginView)
- [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]];
-
- // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
- Frame* coreFrame = core(webFrame);
- if (coreFrame->document() && coreFrame->document()->isMediaDocument())
- coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
-
- if (_private->pluginView) {
- if (!_private->hasSentResponseToPlugin) {
- [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
- _private->hasSentResponseToPlugin = YES;
- }
-
- [_private->manualLoader pluginView:_private->pluginView receivedData:data];
+ if (!webFrame)
+ return;
+
+ if (!_private->pluginView)
+ [webFrame _commitData:data];
+
+ // If the document is a stand-alone media document, now is the right time to cancel the WebKit load
+ Frame* coreFrame = core(webFrame);
+ if (coreFrame->document()->isMediaDocument())
+ coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response()));
+
+ if (_private->pluginView) {
+ if (!_private->hasSentResponseToPlugin) {
+ [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]];
+ _private->hasSentResponseToPlugin = YES;
}
+
+ [_private->manualLoader pluginView:_private->pluginView receivedData:data];
}
}
@@ -195,25 +196,26 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
{
- WebFrame *frame = [dataSource webFrame];
+ WebFrame* webFrame = [dataSource webFrame];
if (_private->pluginView) {
[_private->manualLoader pluginViewFinishedLoading:_private->pluginView];
return;
}
- if (frame) {
- if (![self _isDisplayingWebArchive]) {
- // Telling the frame we received some data and passing nil as the data is our
- // way to get work done that is normally done when the first bit of data is
- // received, even for the case of a document with no data (like about:blank).
- [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]];
- }
-
- WebView *webView = [frame webView];
- if ([webView isEditable])
- core(frame)->editor()->applyEditingStyleToBodyElement();
+ if (!webFrame)
+ return;
+
+ if (![self _isDisplayingWebArchive]) {
+ // Telling the frame we received some data and passing nil as the data is our
+ // way to get work done that is normally done when the first bit of data is
+ // received, even for the case of a document with no data (like about:blank).
+ [webFrame _commitData:nil];
}
+
+ WebView *webView = [webFrame webView];
+ if ([webView isEditable])
+ core(webFrame)->editor()->applyEditingStyleToBodyElement();
}
- (BOOL)canProvideDocumentSource
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 711afb5..7cc80f6 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,5 +1,23 @@
2010-09-10 Adam Barth <abarth at webkit.org>
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code didn't know that setEncoding can be called multiple times.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::finishedLoading):
+ (WebCore::FrameLoaderClientQt::setMainDocumentError):
+ (WebCore::FrameLoaderClientQt::committedLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoading):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2010-09-10 Adam Barth <abarth at webkit.org>
+
Reviewed by Eric Seidel.
Main resource bytes shouldn't bounce through FrameLoader
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index cb14b4b..1628634 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -189,7 +189,6 @@ static const char* navigationTypeToString(NavigationType type)
FrameLoaderClientQt::FrameLoaderClientQt()
: m_frame(0)
, m_webFrame(0)
- , m_firstData(false)
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
, m_loadError (ResourceError())
@@ -581,19 +580,12 @@ void FrameLoaderClientQt::didChangeTitle(DocumentLoader*)
void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader)
{
- if (!m_pluginView) {
- if(m_firstData) {
- FrameLoader *fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- }
- else {
- if (m_pluginView->isPluginView())
- m_pluginView->didFinishLoading();
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ if (m_pluginView->isPluginView())
+ m_pluginView->didFinishLoading();
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
@@ -776,32 +768,19 @@ bool FrameLoaderClientQt::canCachePage() const
void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError& error)
{
- if (!m_pluginView) {
- if (m_firstData) {
- loader->frameLoader()->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- } else {
- if (m_pluginView->isPluginView())
- m_pluginView->didFail(error);
- m_pluginView = 0;
- m_hasSentResponseToPlugin = false;
- }
+ if (!m_pluginView)
+ return;
+ if (m_pluginView->isPluginView())
+ m_pluginView->didFail(error);
+ m_pluginView = 0;
+ m_hasSentResponseToPlugin = false;
}
// FIXME: This function should be moved into WebCore.
void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
- if (!m_pluginView) {
- if (!m_frame)
- return;
- FrameLoader *fl = loader->frameLoader();
- if (m_firstData) {
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
- fl->documentLoader()->addData(data, length);
- }
+ if (!m_pluginView)
+ loader->commitData(data, length);
// We re-check here as the plugin can have been created
if (m_pluginView && m_pluginView->isPluginView()) {
@@ -962,7 +941,6 @@ void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, u
{
m_response = response;
- m_firstData = true;
if (dumpResourceLoadCallbacks)
printf("%s - didReceiveResponse %s\n",
qPrintable(dumpAssignedUrls[identifier]),
@@ -992,12 +970,6 @@ void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader
printf("%s - didFailLoadingWithError: %s\n",
(dumpAssignedUrls.contains(identifier) ? qPrintable(dumpAssignedUrls[identifier]) : "<unknown>"),
qPrintable(drtDescriptionSuitableForTestResult(error)));
-
- if (m_firstData) {
- FrameLoader *fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- m_firstData = false;
- }
}
bool FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int)
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index e506900..86c57af 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -232,7 +232,6 @@ private:
Frame *m_frame;
QWebFrame *m_webFrame;
ResourceResponse m_response;
- bool m_firstData;
// Plugin view to redirect data to
WebCore::PluginView* m_pluginView;
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index e45ecde..ab4f7b3 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::committedLoad):
+ * WebCoreSupport/WebFrameLoaderClient.h:
+
2010-09-09 Darin Adler <darin at apple.com>
Reviewed by Adam Barth.
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 886f23c..1fb827d 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -491,11 +491,8 @@ void WebFrameLoaderClient::postProgressFinishedNotification()
void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
{
- // FIXME: This should probably go through the data source.
- const String& textEncoding = loader->response().textEncodingName();
-
if (!m_manualLoader)
- receivedData(data, length, textEncoding);
+ loader->commitData(data, length);
if (!m_manualLoader)
return;
@@ -512,22 +509,6 @@ void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat
m_manualLoader->didReceiveData(data, length);
}
-// FIXME: This function should be moved into WebCore.
-void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
-{
- Frame* coreFrame = core(m_webFrame);
- if (!coreFrame)
- return;
-
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncoding;
- coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
- coreFrame->loader()->documentLoader()->addData(data, length);
-}
-
void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
{
// Telling the frame we received some data and passing 0 as the data is our
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index 648b5bf..6e8e354 100644
--- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -126,7 +126,6 @@ protected:
private:
PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer);
- void receivedData(const char*, int, const WTF::String&);
WebHistory* webHistory() const;
WebFrame* m_webFrame;
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 718fdfc..0293589 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,5 +1,15 @@
2010-09-10 Adam Barth <abarth at webkit.org>
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ * WebKitSupport/FrameLoaderClientWx.cpp:
+ (WebCore::FrameLoaderClientWx::committedLoad):
+
+2010-09-10 Adam Barth <abarth at webkit.org>
+
Reviewed by Eric Seidel.
Main resource bytes shouldn't bounce through FrameLoader
diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
index eac5af1..999d2cd 100644
--- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
+++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
@@ -617,12 +617,9 @@ void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const c
{
if (!m_webFrame)
return;
- if (!m_pluginView) {
- FrameLoader* fl = loader->frameLoader();
- fl->writer()->setEncoding(m_response.textEncodingName(), false);
- fl->documentLoader()->addData(data, length);
- }
-
+ if (!m_pluginView)
+ loader->commitData(data, length);
+
// We re-check here as the plugin can have been created
if (m_pluginView) {
if (!m_hasSentResponseToPlugin) {
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index ebfdc5d..25d8cbc 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-10 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Darin Fisher.
+
+ Move code from WebKit-layer to DocumentLoader
+ https://bugs.webkit.org/show_bug.cgi?id=45569
+
+ This code looks copy/pasted from Mac. It's unclear whether whether all
+ the complexity is needed here, but I don't have a good way to find out.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::committedLoad):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
2010-09-10 Anders Carlsson <andersca at apple.com>
Reviewed by Mark Rowe and Darin Adler.
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 168948b..1bc1ed7 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -599,12 +599,10 @@ void WebFrameLoaderClient::didChangeTitle(DocumentLoader*)
void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
{
- const String& textEncoding = loader->response().textEncodingName();
-
if (!m_pluginView)
- receivedData(data, length, textEncoding);
+ loader->commitData(data, length);
- // Calling receivedData did not create the plug-in view.
+ // Calling commitData did not create the plug-in view.
if (!m_pluginView)
return;
@@ -620,23 +618,6 @@ void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat
m_pluginView->manualLoadDidReceiveData(data, length);
}
-// FIXME: This function should be moved into WebCore.
-void WebFrameLoaderClient::receivedData(const char* data, int length, const String& textEncoding)
-{
- Frame* coreFrame = m_frame->coreFrame();
- if (!coreFrame)
- return;
-
- // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
- String encoding = coreFrame->loader()->documentLoader()->overrideEncoding();
- bool userChosen = !encoding.isNull();
- if (encoding.isNull())
- encoding = textEncoding;
- coreFrame->loader()->writer()->setEncoding(encoding, userChosen);
-
- coreFrame->loader()->documentLoader()->addData(data, length);
-}
-
void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
{
if (!m_pluginView) {
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
index 98a6512..d652a81 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
@@ -203,8 +203,6 @@ private:
virtual bool shouldUsePluginDocument(const WTF::String& /*mimeType*/) const;
- void receivedData(const char* data, int length, const WTF::String& textEncoding);
-
virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
WebFrame* m_frame;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list