[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andersca at apple.com andersca at apple.com
Wed Dec 22 11:17:01 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9d3a6a0859da660b7b83ae445038e4fd4ecf61f9
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 17:46:46 2010 +0000

    Really add WARN_UNUSED_RESULT to leakRef
    https://bugs.webkit.org/show_bug.cgi?id=42464
    
    Reviewed by David Levin.
    
    JavaScriptCore:
    
    * wtf/PassRefPtr.h:
    (WTF::PassRefPtr::):
    (WTF::NonNullPassRefPtr::):
    Put the WARN_UNUSED_RESULT attribute at the right place.
    
    * wtf/RetainPtr.h:
    (WTF::RetainPtr::releaseRef):
    Remove WARN_UNUSED_RESULT here for now, it leads to two warnings that need
    to be fixed first.
    
    WebCore:
    
    Get rid of a call to releaseRef here by passing the ScriptExecutionContext
    reference through to the DerefContextTask.
    
    * storage/Database.cpp:
    (WebCore::DerefContextTask::create):
    (WebCore::DerefContextTask::performTask):
    (WebCore::DerefContextTask::DerefContextTask):
    (WebCore::Database::~Database):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index afcb343..136e70c 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-16  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by David Levin.
+
+        Really add WARN_UNUSED_RESULT to leakRef
+        https://bugs.webkit.org/show_bug.cgi?id=42464
+
+        * wtf/PassRefPtr.h:
+        (WTF::PassRefPtr::):
+        (WTF::NonNullPassRefPtr::):
+        Put the WARN_UNUSED_RESULT attribute at the right place.
+
+        * wtf/RetainPtr.h:
+        (WTF::RetainPtr::releaseRef):
+        Remove WARN_UNUSED_RESULT here for now, it leads to two warnings that need
+        to be fixed first.
+
 2010-07-15  Victor Wang  <victorw at chromium.org>
 
         Reviewed by David Levin.
diff --git a/JavaScriptCore/wtf/PassRefPtr.h b/JavaScriptCore/wtf/PassRefPtr.h
index 230637a..54fa14c 100644
--- a/JavaScriptCore/wtf/PassRefPtr.h
+++ b/JavaScriptCore/wtf/PassRefPtr.h
@@ -96,7 +96,7 @@ namespace WTF {
         friend PassRefPtr adoptRef<T>(T*);
 
         // FIXME: Remove releaseRef once we change all callers to call leakRef instead.
-        T* releaseRef() const { return leakRef(); } WARN_UNUSED_RETURN;
+        T* releaseRef() const WARN_UNUSED_RETURN { return leakRef(); }
 
     private:
         // adopting constructor
@@ -152,13 +152,13 @@ namespace WTF {
         T* get() const { return m_ptr; }
 
         void clear();
-        T* leakRef() const { T* tmp = m_ptr; m_ptr = 0; return tmp; } WARN_UNUSED_RETURN;
+        T* leakRef() const WARN_UNUSED_RETURN { T* tmp = m_ptr; m_ptr = 0; return tmp; }
 
         T& operator*() const { return *m_ptr; }
         T* operator->() const { return m_ptr; }
 
         // FIXME: Remove releaseRef once we change all callers to call leakRef instead.
-        T* releaseRef() const { return leakRef(); } WARN_UNUSED_RETURN;
+        T* releaseRef() const WARN_UNUSED_RETURN { return leakRef(); }
 
     private:
         mutable T* m_ptr;
diff --git a/JavaScriptCore/wtf/RetainPtr.h b/JavaScriptCore/wtf/RetainPtr.h
index 2768be7..f5a027e 100644
--- a/JavaScriptCore/wtf/RetainPtr.h
+++ b/JavaScriptCore/wtf/RetainPtr.h
@@ -71,7 +71,7 @@ namespace WTF {
         
         PtrType get() const { return m_ptr; }
         
-        PtrType releaseRef() { PtrType tmp = m_ptr; m_ptr = 0; return tmp; } WARN_UNUSED_RETURN;
+        PtrType releaseRef() { PtrType tmp = m_ptr; m_ptr = 0; return tmp; }
         
         PtrType operator->() const { return m_ptr; }
         
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 688ddec..96726d6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-16  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by David Levin.
+
+        Really add WARN_UNUSED_RESULT to leakRef
+        https://bugs.webkit.org/show_bug.cgi?id=42464
+
+        Get rid of a call to releaseRef here by passing the ScriptExecutionContext
+        reference through to the DerefContextTask.
+
+        * storage/Database.cpp:
+        (WebCore::DerefContextTask::create):
+        (WebCore::DerefContextTask::performTask):
+        (WebCore::DerefContextTask::DerefContextTask):
+        (WebCore::Database::~Database):
+
 2010-07-16  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 19f582d..5e271bd 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -140,25 +140,37 @@ Database::Database(ScriptExecutionContext* context, const String& name, const St
 
 class DerefContextTask : public ScriptExecutionContext::Task {
 public:
-    static PassOwnPtr<DerefContextTask> create()
+    static PassOwnPtr<DerefContextTask> create(PassRefPtr<ScriptExecutionContext> context)
     {
-        return new DerefContextTask();
+        return new DerefContextTask(context);
     }
 
     virtual void performTask(ScriptExecutionContext* context)
     {
-        context->deref();
+        ASSERT(context == m_context);
+        m_context.clear();
     }
 
     virtual bool isCleanupTask() const { return true; }
+
+private:
+    DerefContextTask(PassRefPtr<ScriptExecutionContext> context)
+        : m_context(context)
+    {
+    }
+    
+    RefPtr<ScriptExecutionContext> m_context;
 };
 
 Database::~Database()
 {
     // The reference to the ScriptExecutionContext needs to be cleared on the JavaScript thread.  If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
     if (!m_scriptExecutionContext->isContextThread()) {
-        m_scriptExecutionContext->postTask(DerefContextTask::create());
-        m_scriptExecutionContext.release().releaseRef();
+        // Grab a pointer to the script execution here because we're releasing it when we pass it to
+        // DerefContextTask::create.
+        ScriptExecutionContext* scriptExecutionContext = m_scriptExecutionContext.get();
+        
+        scriptExecutionContext->postTask(DerefContextTask::create(m_scriptExecutionContext.release()));
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list