[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
kinuko at chromium.org
kinuko at chromium.org
Wed Dec 22 13:18:16 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 35a4a326fd90dc2ddcaab03b2f53ccaa95a4a1b5
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 10 18:43:37 2010 +0000
2010-09-09 Kinuko Yasuda <kinuko at chromium.org>
Reviewed by Dumitru Daniliuc.
[FileSystem] Do not call EntriesCallback more than once if there're no entries.
https://bugs.webkit.org/show_bug.cgi?id=45498
No new tests, layout-tests that confirm the behavior will be added in later patches.
* fileapi/FileSystemCallbacks.cpp:
(WebCore::EntriesCallbacks::EntriesCallbacks):
(WebCore::EntriesCallbacks::didReadDirectoryEntry):
(WebCore::EntriesCallbacks::didReadDirectoryEntries):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 73f85f4..f6d251e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-09 Kinuko Yasuda <kinuko at chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ [FileSystem] Do not call EntriesCallback more than once if there're no entries.
+ https://bugs.webkit.org/show_bug.cgi?id=45498
+
+ No new tests, layout-tests that confirm the behavior will be added in later patches.
+
+ * fileapi/FileSystemCallbacks.cpp:
+ (WebCore::EntriesCallbacks::EntriesCallbacks):
+ (WebCore::EntriesCallbacks::didReadDirectoryEntry):
+ (WebCore::EntriesCallbacks::didReadDirectoryEntries):
+
2010-09-10 Patrick Gansterer <paroga at paroga.com>
Reviewed by Darin Adler.
diff --git a/WebCore/fileapi/DOMFilePath.cpp b/WebCore/fileapi/DOMFilePath.cpp
index 2da057c..1e0d788 100644
--- a/WebCore/fileapi/DOMFilePath.cpp
+++ b/WebCore/fileapi/DOMFilePath.cpp
@@ -61,7 +61,7 @@ String DOMFilePath::getName(const String& path)
{
int index = path.reverseFind(DOMFilePath::separator);
if (index != -1)
- return path.substring(index);
+ return path.substring(index + 1);
return path;
}
diff --git a/WebCore/fileapi/Entry.cpp b/WebCore/fileapi/Entry.cpp
index fbbedf2..969ae2b 100644
--- a/WebCore/fileapi/Entry.cpp
+++ b/WebCore/fileapi/Entry.cpp
@@ -45,12 +45,8 @@ namespace WebCore {
Entry::Entry(DOMFileSystem* fileSystem, const String& fullPath)
: m_fileSystem(fileSystem)
, m_fullPath(fullPath)
+ , m_name(DOMFilePath::getName(fullPath))
{
- size_t index = fullPath.reverseFind("/");
- if (index != notFound)
- m_name = fullPath.substring(index);
- else
- m_name = fullPath;
}
void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index 741df78..d59e47a 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -128,13 +128,12 @@ EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback,
, m_successCallback(successCallback)
, m_fileSystem(fileSystem)
, m_basePath(basePath)
+ , m_entries(EntryArray::create())
{
}
void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirectory)
{
- if (!m_entries)
- m_entries = EntryArray::create();
if (isDirectory)
m_entries->append(DirectoryEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name)));
else
@@ -143,15 +142,14 @@ void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirector
void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
{
- ASSERT(m_entries);
if (m_successCallback) {
m_successCallback->handleEvent(m_entries.get());
- m_entries->clear();
- if (!hasMore) {
- // If there're no more entries, call back once more with an empty array.
- m_successCallback->handleEvent(m_entries.get());
+ if (!m_entries->isEmpty() && !hasMore) {
+ // If we have returned some entries and there're no more coming entries (hasMore==false), call back once more with an empty array.
+ m_successCallback->handleEvent(EntryArray::create().get());
m_successCallback.clear();
}
+ m_entries->clear();
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list