[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
yong.li at torchmobile.com
yong.li at torchmobile.com
Wed Jan 20 22:14:03 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit af1b70a897d39cb87d1399318b4cfdcb1cb75b21
Author: yong.li at torchmobile.com <yong.li at torchmobile.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 6 18:25:46 2010 +0000
2010-01-06 Yong Li <yoli at rim.com>
Reviewed by Darin Adler.
Let ReourceLoader deliver segmented data
when loading resource from a SharedBuffer object.
https://bugs.webkit.org/show_bug.cgi?id=33222
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterContentPolicy):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveData):
* loader/ResourceLoader.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 255bd58..98a071d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-06 Yong Li <yoli at rim.com>
+
+ Reviewed by Darin Adler.
+
+ Let ReourceLoader deliver segmented data
+ when loading resource from a SharedBuffer object.
+ https://bugs.webkit.org/show_bug.cgi?id=33222
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::continueAfterContentPolicy):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::didReceiveData):
+ * loader/ResourceLoader.h:
+
2010-01-06 Simon Hausmann <simon.hausmann at nokia.com>
Unreviewed trivial Qt build fix.
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index 1507fe9..ebecdf0 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -596,10 +596,8 @@ void DocumentLoader::substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*
SubstituteResource* resource = it->second.get();
if (resource) {
- SharedBuffer* data = resource->data();
-
loader->didReceiveResponse(resource->response());
- loader->didReceiveData(data->data(), data->size(), data->size(), true);
+ loader->didReceiveData(*resource->data());
loader->didFinishLoading();
} else {
// A null resource means that we should fail the load.
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 3e75880..38f94bc 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -260,7 +260,7 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
if (frameLoader() && !frameLoader()->isStopping()) {
if (m_substituteData.isValid()) {
if (m_substituteData.content()->size())
- didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
+ ResourceLoader::didReceiveData(*m_substituteData.content());
if (frameLoader() && !frameLoader()->isStopping())
didFinishLoading();
} else if (shouldLoadAsEmptyDocument(url) || frameLoader()->representationExistsForURLScheme(url.protocol()))
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp
index 9244cf0..83ef5e9 100644
--- a/WebCore/loader/ResourceLoader.cpp
+++ b/WebCore/loader/ResourceLoader.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* (C) 2007 Graham Dennis (graham.dennis at gmail.com)
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -253,6 +254,16 @@ void ResourceLoader::didReceiveData(const char* data, int length, long long leng
frameLoader()->notifier()->didReceiveData(this, data, length, static_cast<int>(lengthReceived));
}
+void ResourceLoader::didReceiveData(const SharedBuffer& data)
+{
+ const char* segment;
+ unsigned offset = 0;
+ while (unsigned length = data.getSomeData(segment, offset)) {
+ offset += length;
+ didReceiveData(segment, static_cast<int>(length), offset, false);
+ }
+}
+
void ResourceLoader::willStopBufferingData(const char* data, int length)
{
if (!m_shouldBufferData)
diff --git a/WebCore/loader/ResourceLoader.h b/WebCore/loader/ResourceLoader.h
index 5239289..edcb81c 100644
--- a/WebCore/loader/ResourceLoader.h
+++ b/WebCore/loader/ResourceLoader.h
@@ -79,6 +79,7 @@ namespace WebCore {
virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
virtual void didReceiveResponse(const ResourceResponse&);
virtual void didReceiveData(const char*, int, long long lengthReceived, bool allAtOnce);
+ void didReceiveData(const SharedBuffer&);
void willStopBufferingData(const char*, int);
virtual void didFinishLoading();
virtual void didFail(const ResourceError&);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list