[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 15:07:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bb65b1dfcc163fde6097c29716b4044e8c53948e
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 28 03:18:10 2010 +0000

    2010-10-27  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Dumitru Daniliuc.
    
            DOMFileSystem's reference should be kept while there're any active Entries/callbacks
            https://bugs.webkit.org/show_bug.cgi?id=47535
    
            Changed to keep DOMFileSystem's reference in each EntryBase, DirectoryReaderBase, EntryCallbacks and EntriesCallbacks.
    
            Test: fast/filesystem/filesystem-reference.html
    
            * fileapi/DOMFileSystemBase.cpp:
            (WebCore::DOMFileSystemBase::readDirectory): Changed to pass/take
            PassRefPtr but not a raw pointer.
            * fileapi/DOMFileSystemBase.h:
            * fileapi/DirectoryEntry.cpp:
            (WebCore::DirectoryEntry::DirectoryEntry): Ditto.
            (WebCore::DirectoryEntry::createReader):
            * fileapi/DirectoryEntry.h:
            (WebCore::DirectoryEntry::create): Ditto.
            * fileapi/DirectoryEntrySync.cpp:
            (WebCore::DirectoryEntrySync::DirectoryEntrySync): Ditto.
            * fileapi/DirectoryEntrySync.h:
            (WebCore::DirectoryEntrySync::create): Ditto.
            * fileapi/DirectoryReader.h:
            (WebCore::DirectoryReader::filesystem):
            * fileapi/DirectoryReaderBase.h:
            (WebCore::DirectoryReaderBase::filesystem):
            * fileapi/Entry.cpp:
            (WebCore::Entry::Entry): Ditto.
            * fileapi/Entry.h:
            (WebCore::Entry::filesystem):
            * fileapi/EntryBase.h:
            (WebCore::EntryBase::filesystem):
            (WebCore::EntryBase::EntryBase): Ditto.
            * fileapi/EntrySync.cpp:
            (WebCore::EntrySync::create): Ditto.
            (WebCore::EntrySync::getParent):
            (WebCore::EntrySync::EntrySync): Ditto.
            * fileapi/EntrySync.h:
            (WebCore::EntrySync::filesystem):
            * fileapi/FileEntry.cpp:
            (WebCore::FileEntry::FileEntry): Ditto.
            * fileapi/FileEntry.h:
            (WebCore::FileEntry::create): Ditto.
            * fileapi/FileEntrySync.cpp:
            (WebCore::FileEntrySync::FileEntrySync): Ditto.
            * fileapi/FileEntrySync.h:
            (WebCore::FileEntrySync::create): Ditto.
            * fileapi/FileSystemCallbacks.cpp:
            (WebCore::EntriesCallbacks::create): Ditto.
            (WebCore::EntriesCallbacks::EntriesCallbacks): Ditto.
            * fileapi/FileSystemCallbacks.h:
    2010-10-27  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Dumitru Daniliuc.
    
            DOMFileSystem's reference should be kept while there're any active Entries/callbacks
            https://bugs.webkit.org/show_bug.cgi?id=47535
    
            * fast/filesystem/filesystem-reference-expected.txt: Added.
            * fast/filesystem/filesystem-reference.html: Added.
            * fast/filesystem/script-tests/filesystem-reference.js: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70741 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ed4d95e..f2db34b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-27  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Dumitru Daniliuc.
+
+        DOMFileSystem's reference should be kept while there're any active Entries/callbacks
+        https://bugs.webkit.org/show_bug.cgi?id=47535
+
+        * fast/filesystem/filesystem-reference-expected.txt: Added.
+        * fast/filesystem/filesystem-reference.html: Added.
+        * fast/filesystem/script-tests/filesystem-reference.js: Added.
+
 2010-10-27  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/filesystem/filesystem-reference-expected.txt b/LayoutTests/fast/filesystem/filesystem-reference-expected.txt
new file mode 100644
index 0000000..bdee1bf
--- /dev/null
+++ b/LayoutTests/fast/filesystem/filesystem-reference-expected.txt
@@ -0,0 +1,14 @@
+This tests if Entries returned by callbacks keep functioning even after we lose a reference to the filesystem in the script.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Running runTest1()...
+Running runTest2()...
+Running runTest3()...
+Running runTest4()...
+PASS testEntries.length is 4
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/filesystem/filesystem-reference.html b/LayoutTests/fast/filesystem/filesystem-reference.html
new file mode 100644
index 0000000..95244ef
--- /dev/null
+++ b/LayoutTests/fast/filesystem/filesystem-reference.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<script src="resources/fs-test-util.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/filesystem-reference.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/filesystem/script-tests/filesystem-reference.js b/LayoutTests/fast/filesystem/script-tests/filesystem-reference.js
new file mode 100644
index 0000000..63fcc3c
--- /dev/null
+++ b/LayoutTests/fast/filesystem/script-tests/filesystem-reference.js
@@ -0,0 +1,72 @@
+description("This tests if Entries returned by callbacks keep functioning even after we lose a reference to the filesystem in the script.");
+
+var testDirectory = null;
+var testEntries = null;
+
+function errorCallback(error)
+{
+    testFailed("Error occurred: " + error.code);
+    finishJSTest();
+}
+
+function runTest1(root)
+{
+    debug("Running runTest1()...");
+    var helper = new JoinHelper();
+    var done = function() { helper.done(); };
+
+    helper.run(function() { root.getFile('a', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getDirectory('b', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getDirectory('c', {create:true}, done, errorCallback); });
+
+    gc();
+    helper.join(function() { runTest2(root); });
+}
+
+function runTest2(root)
+{
+    debug("Running runTest2()...");
+    var helper = new JoinHelper();
+    var done = function() { helper.done(); };
+
+    helper.run(function() { root.getFile('/b/1', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getFile('/b/2', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getFile('/b/3', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getFile('/b/4', {create:true}, done, errorCallback); });
+    helper.run(function() { root.getDirectory('b', {create:false}, function(entry) { testDirectory = entry; helper.done(); }, errorCallback); });
+
+    gc();
+    helper.join(function() { runTest3(); });
+}
+
+function runTest3()
+{
+    debug("Running runTest3()...");
+    testDirectory.createReader().readEntries(entriesCallback, errorCallback);
+    testDirectory = null;
+    gc();
+}
+
+function entriesCallback(entries)
+{
+    debug("Running runTest4()...");
+    testEntries = entries;
+    shouldBe("testEntries.length", "4");
+    finishJSTest();
+}
+
+function fileSystemCallback(fs)
+{
+    var root = fs.root;
+    removeAllInDirectory(fs.root, function() { runTest1(root); }, errorCallback);
+    fs = null;
+    gc();
+}
+
+if (window.requestFileSystem) {
+    window.jsTestIsAsync = true;
+    requestFileSystem(window.TEMPORARY, 100, fileSystemCallback, errorCallback);
+} else
+    debug("This test requires FileSystem API support.");
+
+window.successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 92d04e8..f6621fb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,57 @@
+2010-10-27  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Dumitru Daniliuc.
+
+        DOMFileSystem's reference should be kept while there're any active Entries/callbacks
+        https://bugs.webkit.org/show_bug.cgi?id=47535
+
+        Changed to keep DOMFileSystem's reference in each EntryBase, DirectoryReaderBase, EntryCallbacks and EntriesCallbacks.
+
+        Test: fast/filesystem/filesystem-reference.html
+
+        * fileapi/DOMFileSystemBase.cpp:
+        (WebCore::DOMFileSystemBase::readDirectory): Changed to pass/take
+        PassRefPtr but not a raw pointer.
+        * fileapi/DOMFileSystemBase.h:
+        * fileapi/DirectoryEntry.cpp:
+        (WebCore::DirectoryEntry::DirectoryEntry): Ditto.
+        (WebCore::DirectoryEntry::createReader):
+        * fileapi/DirectoryEntry.h:
+        (WebCore::DirectoryEntry::create): Ditto.
+        * fileapi/DirectoryEntrySync.cpp:
+        (WebCore::DirectoryEntrySync::DirectoryEntrySync): Ditto.
+        * fileapi/DirectoryEntrySync.h:
+        (WebCore::DirectoryEntrySync::create): Ditto.
+        * fileapi/DirectoryReader.h:
+        (WebCore::DirectoryReader::filesystem):
+        * fileapi/DirectoryReaderBase.h:
+        (WebCore::DirectoryReaderBase::filesystem):
+        * fileapi/Entry.cpp:
+        (WebCore::Entry::Entry): Ditto.
+        * fileapi/Entry.h:
+        (WebCore::Entry::filesystem):
+        * fileapi/EntryBase.h:
+        (WebCore::EntryBase::filesystem):
+        (WebCore::EntryBase::EntryBase): Ditto.
+        * fileapi/EntrySync.cpp:
+        (WebCore::EntrySync::create): Ditto.
+        (WebCore::EntrySync::getParent):
+        (WebCore::EntrySync::EntrySync): Ditto.
+        * fileapi/EntrySync.h:
+        (WebCore::EntrySync::filesystem):
+        * fileapi/FileEntry.cpp:
+        (WebCore::FileEntry::FileEntry): Ditto.
+        * fileapi/FileEntry.h:
+        (WebCore::FileEntry::create): Ditto.
+        * fileapi/FileEntrySync.cpp:
+        (WebCore::FileEntrySync::FileEntrySync): Ditto.
+        * fileapi/FileEntrySync.h:
+        (WebCore::FileEntrySync::create): Ditto.
+        * fileapi/FileSystemCallbacks.cpp:
+        (WebCore::EntriesCallbacks::create): Ditto.
+        (WebCore::EntriesCallbacks::EntriesCallbacks): Ditto.
+        * fileapi/FileSystemCallbacks.h:
+
 2010-10-27  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/fileapi/DOMFileSystemBase.cpp b/WebCore/fileapi/DOMFileSystemBase.cpp
index fefe99f..c462c3c 100644
--- a/WebCore/fileapi/DOMFileSystemBase.cpp
+++ b/WebCore/fileapi/DOMFileSystemBase.cpp
@@ -35,6 +35,7 @@
 
 #include "DOMFilePath.h"
 #include "DirectoryEntry.h"
+#include "DirectoryReaderBase.h"
 #include "EntriesCallback.h"
 #include "EntryArray.h"
 #include "EntryBase.h"
@@ -190,7 +191,7 @@ bool DOMFileSystemBase::getDirectory(const EntryBase* base, const String& path,
     return true;
 }
 
-bool DOMFileSystemBase::readDirectory(DirectoryReaderBase* reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
 {
     ASSERT(DOMFilePath::isAbsolute(path));
     String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
diff --git a/WebCore/fileapi/DOMFileSystemBase.h b/WebCore/fileapi/DOMFileSystemBase.h
index 36e35b4..66f1331 100644
--- a/WebCore/fileapi/DOMFileSystemBase.h
+++ b/WebCore/fileapi/DOMFileSystemBase.h
@@ -72,7 +72,7 @@ public:
     bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
     bool getFile(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
     bool getDirectory(const EntryBase*, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
-    bool readDirectory(DirectoryReaderBase*, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
+    bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
 
 protected:
     DOMFileSystemBase(const String& name, PassOwnPtr<AsyncFileSystem>);
diff --git a/WebCore/fileapi/DirectoryEntry.cpp b/WebCore/fileapi/DirectoryEntry.cpp
index 7915117..7bc0af8 100644
--- a/WebCore/fileapi/DirectoryEntry.cpp
+++ b/WebCore/fileapi/DirectoryEntry.cpp
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-DirectoryEntry::DirectoryEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : Entry(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/DirectoryEntry.h b/WebCore/fileapi/DirectoryEntry.h
index dd0159e..da903da 100644
--- a/WebCore/fileapi/DirectoryEntry.h
+++ b/WebCore/fileapi/DirectoryEntry.h
@@ -49,7 +49,7 @@ class VoidCallback;
 
 class DirectoryEntry : public Entry {
 public:
-    static PassRefPtr<DirectoryEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new DirectoryEntry(fileSystem, fullPath));
     }
@@ -61,7 +61,7 @@ public:
     void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
 
 private:
-    DirectoryEntry(DOMFileSystemBase*, const String& fullPath);
+    DirectoryEntry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 } // namespace
diff --git a/WebCore/fileapi/DirectoryEntrySync.cpp b/WebCore/fileapi/DirectoryEntrySync.cpp
index 021d973..e68f7be 100644
--- a/WebCore/fileapi/DirectoryEntrySync.cpp
+++ b/WebCore/fileapi/DirectoryEntrySync.cpp
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-DirectoryEntrySync::DirectoryEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryEntrySync::DirectoryEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : EntrySync(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/DirectoryEntrySync.h b/WebCore/fileapi/DirectoryEntrySync.h
index 9a3e0df..eb412bb 100644
--- a/WebCore/fileapi/DirectoryEntrySync.h
+++ b/WebCore/fileapi/DirectoryEntrySync.h
@@ -46,7 +46,7 @@ class FileEntrySync;
 
 class DirectoryEntrySync : public EntrySync {
 public:
-    static PassRefPtr<DirectoryEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<DirectoryEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new DirectoryEntrySync(fileSystem, fullPath));
     }
@@ -59,7 +59,7 @@ public:
 
 private:
     friend class EntrySync;
-    DirectoryEntrySync(DOMFileSystemBase*, const String& fullPath);
+    DirectoryEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 }
diff --git a/WebCore/fileapi/DirectoryReader.cpp b/WebCore/fileapi/DirectoryReader.cpp
index 3437675..fe2d99f 100644
--- a/WebCore/fileapi/DirectoryReader.cpp
+++ b/WebCore/fileapi/DirectoryReader.cpp
@@ -40,7 +40,7 @@
 
 namespace WebCore {
 
-DirectoryReader::DirectoryReader(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : DirectoryReaderBase(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/DirectoryReader.h b/WebCore/fileapi/DirectoryReader.h
index 806fdf1..bc89858 100644
--- a/WebCore/fileapi/DirectoryReader.h
+++ b/WebCore/fileapi/DirectoryReader.h
@@ -47,17 +47,17 @@ class ErrorCallback;
 
 class DirectoryReader : public DirectoryReaderBase {
 public:
-    static PassRefPtr<DirectoryReader> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<DirectoryReader> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new DirectoryReader(fileSystem, fullPath));
     }
 
     void readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback> = 0);
 
-    DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+    DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
 
 private:
-    DirectoryReader(DOMFileSystemBase*, const String& fullPath);
+    DirectoryReader(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 }
diff --git a/WebCore/fileapi/DirectoryReaderBase.h b/WebCore/fileapi/DirectoryReaderBase.h
index 5a2c048..4096fe8 100644
--- a/WebCore/fileapi/DirectoryReaderBase.h
+++ b/WebCore/fileapi/DirectoryReaderBase.h
@@ -42,18 +42,18 @@ namespace WebCore {
 
 class DirectoryReaderBase : public RefCounted<DirectoryReaderBase> {
 public:
-    DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+    DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
     void setHasMoreEntries(bool hasMoreEntries) { m_hasMoreEntries = hasMoreEntries; }
 
 protected:
-    DirectoryReaderBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+    DirectoryReaderBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
         : m_fileSystem(fileSystem)
         , m_fullPath(fullPath)
         , m_hasMoreEntries(true)
     {
     }
 
-    DOMFileSystemBase* m_fileSystem;
+    RefPtr<DOMFileSystemBase> m_fileSystem;
 
     // This is a virtual path.
     String m_fullPath;
diff --git a/WebCore/fileapi/DirectoryReaderSync.cpp b/WebCore/fileapi/DirectoryReaderSync.cpp
index 9e5e684..15cdaa8 100644
--- a/WebCore/fileapi/DirectoryReaderSync.cpp
+++ b/WebCore/fileapi/DirectoryReaderSync.cpp
@@ -44,7 +44,7 @@
 
 namespace WebCore {
 
-DirectoryReaderSync::DirectoryReaderSync(DOMFileSystemBase* fileSystem, const String& fullPath)
+DirectoryReaderSync::DirectoryReaderSync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : DirectoryReaderBase(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/DirectoryReaderSync.h b/WebCore/fileapi/DirectoryReaderSync.h
index 39119b7..5e3d61b 100644
--- a/WebCore/fileapi/DirectoryReaderSync.h
+++ b/WebCore/fileapi/DirectoryReaderSync.h
@@ -43,7 +43,7 @@ namespace WebCore {
 
 class DirectoryReaderSync : public DirectoryReaderBase {
 public:
-    static PassRefPtr<DirectoryReaderSync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new DirectoryReaderSync(fileSystem, fullPath));
     }
@@ -51,7 +51,7 @@ public:
     PassRefPtr<EntryArraySync> readEntries(ExceptionCode&);
 
 private:
-    DirectoryReaderSync(DOMFileSystemBase*, const String& fullPath);
+    DirectoryReaderSync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 } // namespace
diff --git a/WebCore/fileapi/Entry.cpp b/WebCore/fileapi/Entry.cpp
index 83e1a1d..9c3fa4e 100644
--- a/WebCore/fileapi/Entry.cpp
+++ b/WebCore/fileapi/Entry.cpp
@@ -42,7 +42,7 @@
 
 namespace WebCore {
 
-Entry::Entry(DOMFileSystemBase* fileSystem, const String& fullPath)
+Entry::Entry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : EntryBase(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/Entry.h b/WebCore/fileapi/Entry.h
index 36f85eb..9367f4f 100644
--- a/WebCore/fileapi/Entry.h
+++ b/WebCore/fileapi/Entry.h
@@ -49,7 +49,7 @@ class VoidCallback;
 
 class Entry : public EntryBase {
 public:
-    DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem); }
+    DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
 
     void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
     void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
@@ -60,7 +60,7 @@ public:
     String toURI(const String& mimeType = String());
 
 protected:
-    Entry(DOMFileSystemBase*, const String& fullPath);
+    Entry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 } // namespace WebCore
diff --git a/WebCore/fileapi/EntryBase.h b/WebCore/fileapi/EntryBase.h
index 2aaeba8..16f93ba 100644
--- a/WebCore/fileapi/EntryBase.h
+++ b/WebCore/fileapi/EntryBase.h
@@ -48,7 +48,7 @@ class EntryBase : public RefCounted<EntryBase> {
 public:
     virtual ~EntryBase() { }
 
-    DOMFileSystemBase* filesystem() const { return m_fileSystem; }
+    DOMFileSystemBase* filesystem() const { return m_fileSystem.get(); }
 
     virtual bool isFile() const { return false; }
     virtual bool isDirectory() const { return false; }
@@ -57,7 +57,7 @@ public:
     const String& name() const { return m_name; }
 
 protected:
-    EntryBase(DOMFileSystemBase* fileSystem, const String& fullPath)
+    EntryBase(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
         : m_fileSystem(fileSystem)
         , m_fullPath(fullPath)
         , m_name(DOMFilePath::getName(fullPath))
@@ -66,7 +66,7 @@ protected:
 
     friend class EntrySync;
 
-    DOMFileSystemBase* m_fileSystem;
+    RefPtr<DOMFileSystemBase> m_fileSystem;
 
     // This is a virtual path.
     String m_fullPath;
diff --git a/WebCore/fileapi/EntrySync.cpp b/WebCore/fileapi/EntrySync.cpp
index a06bd22..299aeda 100644
--- a/WebCore/fileapi/EntrySync.cpp
+++ b/WebCore/fileapi/EntrySync.cpp
@@ -102,7 +102,7 @@ PassRefPtr<EntrySync> EntrySync::getParent() const
     return DirectoryEntrySync::create(m_fileSystem, parentPath);
 }
 
-EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+EntrySync::EntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : EntryBase(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/EntrySync.h b/WebCore/fileapi/EntrySync.h
index 24a0101..175d591 100644
--- a/WebCore/fileapi/EntrySync.h
+++ b/WebCore/fileapi/EntrySync.h
@@ -49,7 +49,7 @@ class EntrySync : public EntryBase {
 public:
     static PassRefPtr<EntrySync> create(EntryBase*);
 
-    DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem); }
+    DOMFileSystemSync* filesystem() const { return static_cast<DOMFileSystemSync*>(m_fileSystem.get()); }
 
     PassRefPtr<Metadata> getMetadata(ExceptionCode&);
     PassRefPtr<EntrySync> moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionCode&) const;
@@ -58,7 +58,7 @@ public:
     PassRefPtr<EntrySync> getParent() const;
 
 protected:
-    EntrySync(DOMFileSystemBase*, const String& fullPath);
+    EntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 }
diff --git a/WebCore/fileapi/FileEntry.cpp b/WebCore/fileapi/FileEntry.cpp
index 29cbd33..a5ecff5 100644
--- a/WebCore/fileapi/FileEntry.cpp
+++ b/WebCore/fileapi/FileEntry.cpp
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-FileEntry::FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntry::FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : Entry(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/FileEntry.h b/WebCore/fileapi/FileEntry.h
index 216cca2..2fa4394 100644
--- a/WebCore/fileapi/FileEntry.h
+++ b/WebCore/fileapi/FileEntry.h
@@ -43,7 +43,7 @@ class DOMFileSystemBase;
 
 class FileEntry : public Entry {
 public:
-    static PassRefPtr<FileEntry> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new FileEntry(fileSystem, fullPath));
     }
@@ -54,7 +54,7 @@ public:
     virtual bool isFile() const { return true; }
 
 private:
-    FileEntry(DOMFileSystemBase* fileSystem, const String& fullPath);
+    FileEntry(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath);
 };
 
 } // namespace
diff --git a/WebCore/fileapi/FileEntrySync.cpp b/WebCore/fileapi/FileEntrySync.cpp
index 8fc5a77..36ec735 100644
--- a/WebCore/fileapi/FileEntrySync.cpp
+++ b/WebCore/fileapi/FileEntrySync.cpp
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-FileEntrySync::FileEntrySync(DOMFileSystemBase* fileSystem, const String& fullPath)
+FileEntrySync::FileEntrySync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     : EntrySync(fileSystem, fullPath)
 {
 }
diff --git a/WebCore/fileapi/FileEntrySync.h b/WebCore/fileapi/FileEntrySync.h
index d027f63..be12e21 100644
--- a/WebCore/fileapi/FileEntrySync.h
+++ b/WebCore/fileapi/FileEntrySync.h
@@ -44,7 +44,7 @@ class File;
 
 class FileEntrySync : public EntrySync {
 public:
-    static PassRefPtr<FileEntrySync> create(DOMFileSystemBase* fileSystem, const String& fullPath)
+    static PassRefPtr<FileEntrySync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
     {
         return adoptRef(new FileEntrySync(fileSystem, fullPath));
     }
@@ -55,7 +55,7 @@ public:
 
 private:
     friend class EntrySync;
-    FileEntrySync(DOMFileSystemBase*, const String& fullPath);
+    FileEntrySync(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
 };
 
 }
diff --git a/WebCore/fileapi/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp
index 453fcf1..df5d18c 100644
--- a/WebCore/fileapi/FileSystemCallbacks.cpp
+++ b/WebCore/fileapi/FileSystemCallbacks.cpp
@@ -110,12 +110,12 @@ void FileSystemCallbacksBase::didFail(int code)
 
 // EntryCallbacks -------------------------------------------------------------
 
-PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+PassOwnPtr<EntryCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
 {
     return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
 }
 
-EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem, const String& expectedPath, bool isDirectory)
+EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
     : FileSystemCallbacksBase(errorCallback)
     , m_successCallback(successCallback)
     , m_fileSystem(fileSystem)
@@ -137,12 +137,12 @@ void EntryCallbacks::didSucceed()
 
 // EntriesCallbacks -----------------------------------------------------------
 
-PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+PassOwnPtr<EntriesCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
 {
     return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath));
 }
 
-EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DirectoryReaderBase* directoryReader, const String& basePath)
+EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
     : FileSystemCallbacksBase(errorCallback)
     , m_successCallback(successCallback)
     , m_directoryReader(directoryReader)
diff --git a/WebCore/fileapi/FileSystemCallbacks.h b/WebCore/fileapi/FileSystemCallbacks.h
index c600a76..85723c6 100644
--- a/WebCore/fileapi/FileSystemCallbacks.h
+++ b/WebCore/fileapi/FileSystemCallbacks.h
@@ -86,27 +86,27 @@ protected:
 
 class EntryCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+    static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
     virtual void didSucceed();
 
 private:
-    EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*, const String& expectedPath, bool isDirectory);
+    EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
     RefPtr<EntryCallback> m_successCallback;
-    DOMFileSystemBase* m_fileSystem;
+    RefPtr<DOMFileSystemBase> m_fileSystem;
     String m_expectedPath;
     bool m_isDirectory;
 };
 
 class EntriesCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+    static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
     virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
     virtual void didReadDirectoryEntries(bool hasMore);
 
 private:
-    EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DirectoryReaderBase*, const String& basePath);
+    EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
     RefPtr<EntriesCallback> m_successCallback;
-    DirectoryReaderBase* m_directoryReader;
+    RefPtr<DirectoryReaderBase> m_directoryReader;
     String m_basePath;
     RefPtr<EntryArray> m_entries;
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list