[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dimich at chromium.org dimich at chromium.org
Thu Apr 8 00:28:08 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 6db9c80638fca97c2e72767a325e8140230c2b98
Author: dimich at chromium.org <dimich at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 20:25:10 2009 +0000

    Add asserts to RefCounted to make sure ref/deref happens on the right thread.
    https://bugs.webkit.org/show_bug.cgi?id=31639
    
    Reviewed by Darin Adler.
    
    JavaScriptCore:
    
    * runtime/Structure.cpp:
    (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount().
    * wtf/RefCounted.h:
    (WTF::RefCountedBase::ref): Add ASSERT.
    (WTF::RefCountedBase::hasOneRef): Ditto.
    (WTF::RefCountedBase::refCount): Ditto.
    (WTF::RefCountedBase::derefBase): Ditto.
    (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method.
    * wtf/ThreadVerifier.h: Added.
    (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread.
    (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2.
    (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2.
    (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc)
    (WTF::ThreadVerifier::verifyThread):
    * GNUmakefile.am: Add ThreadVerifier.h to the build file.
    * JavaScriptCore.gypi: Ditto.
    * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
    * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
    
    JavaScriptGlue:
    
    * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
    
    WebCore:
    
    * loader/icon/IconRecord.cpp:
    (WebCore::IconRecord::IconRecord): Disable thread verification for this class because of its cross-thread use in IconDatabase.
    * platform/SharedBuffer.cpp:
    (WebCore::SharedBuffer::SharedBuffer): Ditto.
    * platform/text/StringImpl.cpp:
    (WebCore::StringImpl::StringImpl): Disable thread verification for this class, add FIXME to enforce proper usage via crossThreadString.
    * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
    
    WebKit/mac:
    
    * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
    
    WebKitTools:
    
    * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index a2faa38..93efbf1 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,29 @@
+2009-12-08  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+        https://bugs.webkit.org/show_bug.cgi?id=31639
+
+        * runtime/Structure.cpp:
+        (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount().
+        * wtf/RefCounted.h:
+        (WTF::RefCountedBase::ref): Add ASSERT.
+        (WTF::RefCountedBase::hasOneRef): Ditto.
+        (WTF::RefCountedBase::refCount): Ditto.
+        (WTF::RefCountedBase::derefBase): Ditto.
+        (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method.
+        * wtf/ThreadVerifier.h: Added.
+        (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread.
+        (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2.
+        (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2.
+        (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc)
+        (WTF::ThreadVerifier::verifyThread):
+        * GNUmakefile.am: Add ThreadVerifier.h to the build file.
+        * JavaScriptCore.gypi: Ditto.
+        * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
+        * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
+
 2009-12-08  Steve Block  <steveblock at google.com>
 
         Reviewed by Adam Barth.
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index 2132f77..2625110 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -281,6 +281,7 @@ javascriptcore_sources += \
 	JavaScriptCore/wtf/Threading.h \
 	JavaScriptCore/wtf/Threading.cpp \
 	JavaScriptCore/wtf/ThreadingPthreads.cpp \
+	JavaScriptCore/wtf/ThreadVerifier.h \
 	JavaScriptCore/wtf/TypeTraits.cpp \
 	JavaScriptCore/wtf/TypeTraits.h \
 	JavaScriptCore/wtf/UnusedParam.h \
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index 38097c9..68c143f 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -427,6 +427,7 @@
             'wtf/ThreadingWin.cpp',
             'wtf/ThreadSpecific.h',
             'wtf/ThreadSpecificWin.cpp',
+            'wtf/ThreadVerifier.h',
             'wtf/TypeTraits.cpp',
             'wtf/TypeTraits.h',
             'wtf/unicode/Collator.h',
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index 78f507a..89a79c7 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -513,6 +513,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\wtf\ThreadVerifier.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\wtf\TypeTraits.cpp"
 			>
 		</File>
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 7969f47..227e967 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -175,6 +175,7 @@
 		14F8BA4F107EC899009892DC /* Collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8520255597D01FF60F7 /* Collector.cpp */; };
 		180B9B080F16D94F009BDBC5 /* CurrentTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 180B9AF00F16C569009BDBC5 /* CurrentTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		180B9BFE0F16E94D009BDBC5 /* CurrentTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 180B9AEF0F16C569009BDBC5 /* CurrentTime.cpp */; };
+		18470E8310CD8CBB005426C9 /* ThreadVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 18470E7310CD8AB6005426C9 /* ThreadVerifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1C61516C0EBAC7A00031376F /* ProfilerServer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C61516A0EBAC7A00031376F /* ProfilerServer.mm */; settings = {COMPILER_FLAGS = "-fno-strict-aliasing"; }; };
 		1C61516D0EBAC7A00031376F /* ProfilerServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C61516B0EBAC7A00031376F /* ProfilerServer.h */; };
 		41359CF30FDD89AD00206180 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; };
@@ -644,6 +645,7 @@
 		14F3488E0E95EF8A003648BC /* CollectorHeapIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectorHeapIterator.h; sourceTree = "<group>"; };
 		180B9AEF0F16C569009BDBC5 /* CurrentTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CurrentTime.cpp; sourceTree = "<group>"; };
 		180B9AF00F16C569009BDBC5 /* CurrentTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CurrentTime.h; sourceTree = "<group>"; };
+		18470E7310CD8AB6005426C9 /* ThreadVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadVerifier.h; sourceTree = "<group>"; };
 		1C61516A0EBAC7A00031376F /* ProfilerServer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ProfilerServer.mm; path = profiler/ProfilerServer.mm; sourceTree = "<group>"; };
 		1C61516B0EBAC7A00031376F /* ProfilerServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfilerServer.h; path = profiler/ProfilerServer.h; sourceTree = "<group>"; };
 		1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
@@ -1357,6 +1359,7 @@
 				E1EE79220D6C95CD00FEA3BA /* Threading.h */,
 				E1EE793C0D6C9B9200FEA3BA /* ThreadingPthreads.cpp */,
 				E1B7C8BD0DA3A3360074B0DC /* ThreadSpecific.h */,
+				18470E7310CD8AB6005426C9 /* ThreadVerifier.h */,
 				0B330C260F38C62300692DE3 /* TypeTraits.cpp */,
 				0B4D7E620F319AC800AD7E58 /* TypeTraits.h */,
 				935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */,
@@ -1983,6 +1986,7 @@
 				BC18C46F0E16F5CD00B34460 /* TCSystemAlloc.h in Headers */,
 				BC18C4700E16F5CD00B34460 /* Threading.h in Headers */,
 				BC18C4710E16F5CD00B34460 /* ThreadSpecific.h in Headers */,
+				18470E8310CD8CBB005426C9 /* ThreadVerifier.h in Headers */,
 				14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */,
 				5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
 				6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */,
diff --git a/JavaScriptCore/runtime/Structure.cpp b/JavaScriptCore/runtime/Structure.cpp
index e4c9ac3..d2f05c0 100644
--- a/JavaScriptCore/runtime/Structure.cpp
+++ b/JavaScriptCore/runtime/Structure.cpp
@@ -146,6 +146,10 @@ Structure::Structure(JSValue prototype, const TypeInfo& typeInfo)
         ignoreSet.add(this);
     else
         structureCounter.increment();
+
+    // Use of addressOfCount() in this class prevents thread verification in RefCounted
+    // since it modifies refcount via other means than ref()/deref().
+    disableThreadVerification();
 #endif
 
 #if DUMP_STRUCTURE_ID_STATISTICS
diff --git a/JavaScriptCore/wtf/RefCounted.h b/JavaScriptCore/wtf/RefCounted.h
index 761a856..4390cb8 100644
--- a/JavaScriptCore/wtf/RefCounted.h
+++ b/JavaScriptCore/wtf/RefCounted.h
@@ -23,6 +23,7 @@
 
 #include <wtf/Assertions.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/ThreadVerifier.h>
 
 namespace WTF {
 
@@ -33,21 +34,40 @@ class RefCountedBase {
 public:
     void ref()
     {
+#ifndef NDEBUG
+        // Start thread verification as soon as the ref count gets to 2.
+        // The class gets created with a ref count of 1 and then passed
+        // to another thread where to ref count get increased. This
+        // is a heuristic but it seems to always work and has helped
+        // find some bugs.
+        if (m_refCount == 1)
+            m_threadVerifier.activate();
+#endif
+        ASSERT(m_threadVerifier.verifyThread());
         ASSERT(!m_deletionHasBegun);
         ++m_refCount;
     }
 
     bool hasOneRef() const
     {
+        ASSERT(m_threadVerifier.verifyThread());
         ASSERT(!m_deletionHasBegun);
         return m_refCount == 1;
     }
 
     int refCount() const
     {
+        ASSERT(m_threadVerifier.verifyThread());
         return m_refCount;
     }
 
+    void disableThreadVerification()
+    {
+#ifndef NDEBUG
+        m_threadVerifier.disableThreadVerification();
+#endif
+    }
+
 protected:
     RefCountedBase()
         : m_refCount(1)
@@ -64,6 +84,7 @@ protected:
     // Returns whether the pointer should be freed or not.
     bool derefBase()
     {
+        ASSERT(m_threadVerifier.verifyThread());
         ASSERT(!m_deletionHasBegun);
         ASSERT(m_refCount > 0);
         if (m_refCount == 1) {
@@ -74,6 +95,12 @@ protected:
         }
 
         --m_refCount;
+#ifndef NDEBUG
+        // Stop thread verification when the ref goes to 1 because it
+        // is safe to be passed to another thread at this point.
+        if (m_refCount == 1)
+            m_threadVerifier.deactivate();
+#endif
         return false;
     }
 
@@ -97,6 +124,7 @@ private:
     int m_refCount;
 #ifndef NDEBUG
     bool m_deletionHasBegun;
+    ThreadVerifier m_threadVerifier;
 #endif
 };
 
diff --git a/JavaScriptCore/wtf/ThreadVerifier.h b/JavaScriptCore/wtf/ThreadVerifier.h
new file mode 100644
index 0000000..c6240cd
--- /dev/null
+++ b/JavaScriptCore/wtf/ThreadVerifier.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ThreadVerifier_h
+#define ThreadVerifier_h
+
+#ifndef NDEBUG
+
+#include <wtf/Assertions.h>
+#include <wtf/Threading.h>
+
+namespace WTF {
+
+class ThreadVerifier {
+public:
+    ThreadVerifier()
+        : m_isActive(false)
+        , m_isThreadVerificationDisabled(false)
+        , m_isOwnedByMainThread(false)
+        , m_owningThread(0)
+    {
+    }
+
+    // Capture the current thread and start verifying that subsequent ref/deref happen on this thread.
+    void activate()
+    {
+        ASSERT(m_isThreadVerificationDisabled || !m_isActive);
+        m_isActive = true;
+        m_isOwnedByMainThread = isMainThread();
+        if (!m_isOwnedByMainThread)
+            m_owningThread = currentThread();
+    }
+
+    void deactivate()
+    {
+        ASSERT(m_isThreadVerificationDisabled || m_isActive);
+        m_isActive = false;
+    }
+
+    // Permanently disable the verification on the instance. Used for RefCounted that are intentionally used cross-thread.
+    void disableThreadVerification() { m_isThreadVerificationDisabled = true; }
+
+    bool verifyThread() const
+    {
+        // isMainThread() is way faster then currentThread() on many platforms, use it first.
+        return m_isThreadVerificationDisabled || !m_isActive || (m_isOwnedByMainThread && isMainThread()) || (m_owningThread == currentThread());
+    }
+
+private:
+    bool m_isActive;
+    bool m_isThreadVerificationDisabled;
+    bool m_isOwnedByMainThread;
+    ThreadIdentifier m_owningThread;
+};
+
+} // namespace WTF
+
+#endif // NDEBUG
+
+#endif // ThreadVerifier_h
+
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index a262b93..a919986 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-08  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+        https://bugs.webkit.org/show_bug.cgi?id=31639
+
+        * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+
 2009-11-24  Mark Rowe  <mrowe at apple.com>
 
         Fix production builds where the source tree may be read-only.
diff --git a/JavaScriptGlue/ForwardingHeaders/wtf/ThreadVerifier.h b/JavaScriptGlue/ForwardingHeaders/wtf/ThreadVerifier.h
new file mode 100644
index 0000000..9ba6fe2
--- /dev/null
+++ b/JavaScriptGlue/ForwardingHeaders/wtf/ThreadVerifier.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/ThreadVerifier.h>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 63cc665..5f8de57 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-12-08  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+        https://bugs.webkit.org/show_bug.cgi?id=31639
+
+        * loader/icon/IconRecord.cpp:
+        (WebCore::IconRecord::IconRecord): Disable thread verification for this class because of its cross-thread use in IconDatabase.
+        * platform/SharedBuffer.cpp:
+        (WebCore::SharedBuffer::SharedBuffer): Ditto.
+        * platform/text/StringImpl.cpp:
+        (WebCore::StringImpl::StringImpl): Disable thread verification for this class, add FIXME to enforce proper usage via crossThreadString.
+        * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+
 2009-12-08  John Gregg  <johnnyg at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/ForwardingHeaders/wtf/ThreadVerifier.h b/WebCore/ForwardingHeaders/wtf/ThreadVerifier.h
new file mode 100644
index 0000000..d5bceb7
--- /dev/null
+++ b/WebCore/ForwardingHeaders/wtf/ThreadVerifier.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_ThreadVerifier_h
+#define WebCore_FWD_ThreadVerifier_h
+#include <JavaScriptCore/ThreadVerifier.h>
+#endif
diff --git a/WebCore/loader/icon/IconRecord.cpp b/WebCore/loader/icon/IconRecord.cpp
index ffea318..0adf368 100644
--- a/WebCore/loader/icon/IconRecord.cpp
+++ b/WebCore/loader/icon/IconRecord.cpp
@@ -44,7 +44,8 @@ IconRecord::IconRecord(const String& url)
     , m_stamp(0)
     , m_dataSet(false)
 {
-
+    // Currently, this class is shared cross-thread in IconDatabase.
+    disableThreadVerification();
 }
 
 IconRecord::~IconRecord()
diff --git a/WebCore/platform/SharedBuffer.cpp b/WebCore/platform/SharedBuffer.cpp
index 4a0d0f3..138a093 100644
--- a/WebCore/platform/SharedBuffer.cpp
+++ b/WebCore/platform/SharedBuffer.cpp
@@ -32,15 +32,21 @@ namespace WebCore {
 
 SharedBuffer::SharedBuffer()
 {
+    // Currently, this class is shared cross-thread in IconDatabase.
+    disableThreadVerification();
 }
 
 SharedBuffer::SharedBuffer(const char* data, int size)
 {
+    // Currently, this class is shared cross-thread in IconDatabase.
+    disableThreadVerification();
     m_buffer.append(data, size);
 }
 
 SharedBuffer::SharedBuffer(const unsigned char* data, int size)
 {
+    // Currently, this class is shared cross-thread in IconDatabase.
+    disableThreadVerification();
     m_buffer.append(data, size);
 }
     
diff --git a/WebCore/platform/text/StringImpl.cpp b/WebCore/platform/text/StringImpl.cpp
index 5cf4ced..385fc46 100644
--- a/WebCore/platform/text/StringImpl.cpp
+++ b/WebCore/platform/text/StringImpl.cpp
@@ -83,6 +83,9 @@ StringImpl::StringImpl()
     , m_length(0)
     , m_hash(0)
 {
+    // FIXME: It should be possible to check for proper cross-thread usage (see crossThreadString).
+    disableThreadVerification();
+
     // Ensure that the hash is computed so that AtomicStringHash can call existingHash()
     // with impunity. The empty string is special because it is never entered into
     // AtomicString's HashKey, but still needs to compare correctly.
@@ -96,6 +99,8 @@ inline StringImpl::StringImpl(const UChar* characters, unsigned length)
 {
     ASSERT(characters);
     ASSERT(length);
+    // FIXME: It should be possible to check for proper cross-thread usage (see crossThreadString).
+    disableThreadVerification();
 }
 
 StringImpl::~StringImpl()
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 7f1dafc..b0dceac 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-08  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+        https://bugs.webkit.org/show_bug.cgi?id=31639
+
+        * ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+
 2009-12-07  Dmitry Titov  <dimich at chromium.org>
 
         Rubber-stamped by Darin Adler.
diff --git a/WebKit/mac/ForwardingHeaders/wtf/ThreadVerifier.h b/WebKit/mac/ForwardingHeaders/wtf/ThreadVerifier.h
new file mode 100644
index 0000000..8251824
--- /dev/null
+++ b/WebKit/mac/ForwardingHeaders/wtf/ThreadVerifier.h
@@ -0,0 +1 @@
+#import <JavaScriptCore/ThreadVerifier.h>
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1d8e83b..ea33865 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-08  Dmitry Titov  <dimich at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+        https://bugs.webkit.org/show_bug.cgi?id=31639
+
+        * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+
 2009-12-08  David Levin  <levin at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h
new file mode 100644
index 0000000..9ba6fe2
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/ThreadVerifier.h>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list