[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:45:48 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit fe0880594353fafc878d9f2e2c6861754767722e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jun 15 05:17:37 2004 +0000

            Reviewed by me, code changes by Patrick Beard.
    
            - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
    
            * bindings/objc/objc_instance.mm:
            (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
            (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
            (ObjcInstance::operator=): More of the same.
            (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
    
            * bindings/objc/objc_runtime.mm:
            (ObjcArray::ObjcArray): Use CFRetain instead of retain.
            (ObjcArray::~ObjcArray): Use CFRelease instead of release.
            (ObjcArray::operator=): More of the same.
    
            * bindings/testbindings.mm: Fixed incorrect license.
            (main): Use [pool drain] if compiling on Tiger.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6837 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index ba86a81..bdf392d 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,23 @@
+2004-06-14  Darin Adler  <darin at apple.com>
+
+        Reviewed by me, code changes by Patrick Beard.
+
+        - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
+
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
+        (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
+        (ObjcInstance::operator=): More of the same.
+        (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
+
+        * bindings/objc/objc_runtime.mm:
+        (ObjcArray::ObjcArray): Use CFRetain instead of retain.
+        (ObjcArray::~ObjcArray): Use CFRelease instead of release.
+        (ObjcArray::operator=): More of the same.
+
+        * bindings/testbindings.mm: Fixed incorrect license.
+        (main): Use [pool drain] if compiling on Tiger.
+
 === Safari-144 ===
 
 2004-06-10  Kevin Decker  <kdecker at apple.com>
diff --git a/JavaScriptCore/bindings/objc/objc_instance.mm b/JavaScriptCore/bindings/objc/objc_instance.mm
index 7a24262..c3c9f6e 100644
--- a/JavaScriptCore/bindings/objc/objc_instance.mm
+++ b/JavaScriptCore/bindings/objc/objc_instance.mm
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -41,41 +41,38 @@ using namespace KJS;
 
 ObjcInstance::ObjcInstance (ObjectStructPtr instance) 
 {
-    _instance = [instance retain];
+    _instance = (id)CFRetain(instance);
     _class = 0;
     _pool = 0;
     _beginCount = 0;
-};
+}
 
 ObjcInstance::~ObjcInstance () 
 {
     if ([_instance respondsToSelector:@selector(finalizeForWebScript)])
         [_instance finalizeForWebScript];
-    [_instance release];
+    CFRelease(_instance);
 }
 
-
 ObjcInstance::ObjcInstance (const ObjcInstance &other) : Instance() 
 {
-    _instance = [other._instance retain];
+    _instance = (id) CFRetain(other._instance);
     _class = other._class;
     _pool = 0;
     _beginCount = 0;
-};
+}
 
-ObjcInstance &ObjcInstance::operator=(const ObjcInstance &other){
-    if (this == &other)
-        return *this;
-    
+ObjcInstance &ObjcInstance::operator=(const ObjcInstance &other)
+{
     ObjectStructPtr _oldInstance = _instance;
-    _instance = [(id)other._instance retain];
-    [(id)_oldInstance release];
+    _instance = (id) CFRetain(other._instance);
+    CFRelease(_oldInstance);
     
     // Classes are kept around forever.
     _class = other._class;
     
     return *this;
-};
+}
 
 void ObjcInstance::begin()
 {
@@ -90,7 +87,11 @@ void ObjcInstance::end()
     _beginCount--;
     assert (_beginCount >= 0);
     if (_beginCount == 0) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
         [_pool release];
+#else
+        [_pool drain];
+#endif
     }
     _pool = 0;
 }
@@ -256,4 +257,4 @@ KJS::Value ObjcInstance::booleanValue() const
 KJS::Value ObjcInstance::valueOf() const 
 {
     return stringValue();
-};
+}
diff --git a/JavaScriptCore/bindings/objc/objc_runtime.mm b/JavaScriptCore/bindings/objc/objc_runtime.mm
index 0b4582f..0ff4ce9 100644
--- a/JavaScriptCore/bindings/objc/objc_runtime.mm
+++ b/JavaScriptCore/bindings/objc/objc_runtime.mm
@@ -137,34 +137,29 @@ void ObjcField::setValueToInstance(KJS::ExecState *exec, const Instance *instanc
 
 ObjcArray::ObjcArray (ObjectStructPtr a) 
 {
-    _array = [a retain];
-};
+    _array = (id)CFRetain(a);
+}
 
 ObjcArray::~ObjcArray () 
 {
-    [_array release];
+    CFRelease(_array);
 }
 
 
 ObjcArray::ObjcArray (const ObjcArray &other) : Array() 
 {
-    if (other._array != _array) {
-        [_array release];
-        _array = [other._array retain];
-    }
-};
+    _array = other._array;
+    CFRetain(_array);
+}
 
-ObjcArray &ObjcArray::operator=(const ObjcArray &other) {
-    if (this == &other)
-        return *this;
-    
+ObjcArray &ObjcArray::operator=(const ObjcArray &other)
+{
     ObjectStructPtr _oldArray = _array;
     _array = other._array;
-    [_array retain];
-    [_oldArray release];
-    
+    CFRetain(_array);
+    CFRelease(_oldArray);
     return *this;
-};
+}
 
 void ObjcArray::setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const
 {
diff --git a/JavaScriptCore/bindings/testbindings.mm b/JavaScriptCore/bindings/testbindings.mm
index 397514c..d1ea852 100644
--- a/JavaScriptCore/bindings/testbindings.mm
+++ b/JavaScriptCore/bindings/testbindings.mm
@@ -1,24 +1,28 @@
-// -*- c-basic-offset: 2 -*-
 /*
- *  This file is part of the KDE libraries
- *  Copyright (C) 1999-2000 Harri Porten (porten at kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- *  Boston, MA 02111-1307, USA.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
  *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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. 
  */
+
 #include <Foundation/Foundation.h>
 
 #import <WebKit/WebScriptObject.h>
@@ -243,7 +247,11 @@ int main(int argc, char **argv)
         
         Interpreter::unlock();
         
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
         [pool release];
+#else
+        [pool drain];
+#endif
     } // end block, so that Interpreter and global get deleted
     
     return ret ? 0 : 3;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list