Remove JSDependentRetained.h and V8DependentRetained.h
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2012 08:43:22 +0000 (08:43 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2012 08:43:22 +0000 (08:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=104232

Reviewed by Adam Barth.

Although (JS|V8)DependentRetained.h were introduced for MutationObservers,
they are not going to be used (See the discussion in bug 95519).
We can remove them.

No tests. No change in behavior.

* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDependentRetained.h: Removed.
* bindings/v8/V8DependentRetained.h: Removed.
* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::V8PerIsolateData):
* bindings/v8/V8PerIsolateData.h:
(V8PerIsolateData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDependentRetained.h [deleted file]
Source/WebCore/bindings/v8/V8DependentRetained.h [deleted file]
Source/WebCore/bindings/v8/V8PerIsolateData.cpp
Source/WebCore/bindings/v8/V8PerIsolateData.h

index 6eb9a2c..11e2be2 100644 (file)
@@ -1,5 +1,29 @@
 2012-12-06  Kentaro Hara  <haraken@chromium.org>
 
+        Remove JSDependentRetained.h and V8DependentRetained.h
+        https://bugs.webkit.org/show_bug.cgi?id=104232
+
+        Reviewed by Adam Barth.
+
+        Although (JS|V8)DependentRetained.h were introduced for MutationObservers,
+        they are not going to be used (See the discussion in bug 95519).
+        We can remove them.
+
+        No tests. No change in behavior.
+
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDependentRetained.h: Removed.
+        * bindings/v8/V8DependentRetained.h: Removed.
+        * bindings/v8/V8PerIsolateData.cpp:
+        (WebCore::V8PerIsolateData::V8PerIsolateData):
+        * bindings/v8/V8PerIsolateData.h:
+        (V8PerIsolateData):
+
+2012-12-06  Kentaro Hara  <haraken@chromium.org>
+
         [V8] Replace v8String("symbol") with v8::String::NewSymbol("symbol")
         https://bugs.webkit.org/show_bug.cgi?id=104209
 
index d1c860a..2069b19 100644 (file)
@@ -2276,7 +2276,6 @@ webcore_sources += \
        Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
        Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp \
        Source/WebCore/bindings/js/JSCustomXPathNSResolver.h \
-       Source/WebCore/bindings/js/JSDependentRetained.h \
        Source/WebCore/bindings/js/JSDictionary.cpp \
        Source/WebCore/bindings/js/JSDictionary.h \
        Source/WebCore/bindings/js/JSDOMBinding.cpp \
index 00bd15f..654b057 100644 (file)
             'bindings/v8/V8Callback.h',
             'bindings/v8/V8Collection.cpp',
             'bindings/v8/V8Collection.h',
-            'bindings/v8/V8DependentRetained.h',
             'bindings/v8/V8DOMConfiguration.cpp',
             'bindings/v8/V8DOMConfiguration.h',
             'bindings/v8/V8DOMWindowShell.cpp',
index 347bfe5..1074a71 100755 (executable)
                                        </FileConfiguration>
                                </File>
                                <File
-                                       RelativePath="..\bindings\js\JSDependentRetained.h"
-                                       >
-                               </File>
-                               <File
                                        RelativePath="..\bindings\js\JSDesktopNotificationsCustom.cpp"
                                        >
                                        <FileConfiguration
index 855a8b2..4667470 100644 (file)
                FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FF945ECA161F7F3600971BC8 /* PseudoElement.h */; };
                FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */; };
                FFD5B97B135CC97800D5E92A /* PageVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD5B978135CC97800D5E92A /* PageVisibilityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               FFD86E7815F9583600047233 /* JSDependentRetained.h in Headers */ = {isa = PBXBuildFile; fileRef = FFD86E7715F9583600047233 /* JSDependentRetained.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
                FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = "<group>"; };
                FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageVisibilityState.cpp; sourceTree = "<group>"; };
                FFD5B978135CC97800D5E92A /* PageVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageVisibilityState.h; sourceTree = "<group>"; };
-               FFD86E7715F9583600047233 /* JSDependentRetained.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDependentRetained.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                                C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */,
                                1C81BA030E97348300266E07 /* JavaScriptCallFrame.cpp */,
                                1C81BA040E97348300266E07 /* JavaScriptCallFrame.h */,
-                               FFD86E7715F9583600047233 /* JSDependentRetained.h */,
                                BCE438A1140C0DBF005E437E /* JSDictionary.cpp */,
                                BCE4389B140B1BA7005E437E /* JSDictionary.h */,
                                93B70D4709EB0C7C009D8468 /* JSDOMBinding.cpp */,
                                2E97CE701293AD6B00C5C8FF /* JSDataView.h in Headers */,
                                4162A4581011464700DFF3ED /* JSDedicatedWorkerContext.h in Headers */,
                                FDA15ED212B03F94003A583A /* JSDelayNode.h in Headers */,
-                               FFD86E7815F9583600047233 /* JSDependentRetained.h in Headers */,
                                31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */,
                                59A86008119DAFA100DEF1EF /* JSDeviceOrientationEvent.h in Headers */,
                                BCE4389C140B1BA8005E437E /* JSDictionary.h in Headers */,
diff --git a/Source/WebCore/bindings/js/JSDependentRetained.h b/Source/WebCore/bindings/js/JSDependentRetained.h
deleted file mode 100644 (file)
index e82833a..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All Rights Reserved.
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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:
- * 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 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 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.
- */
-
-#ifndef JSDependentRetained_h
-#define JSDependentRetained_h
-
-#include "JSDOMGlobalObject.h"
-#include <heap/Weak.h>
-#include <runtime/JSObject.h>
-#include <runtime/PrivateName.h>
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class JSDependentRetained {
-public:
-    JSDependentRetained(JSC::JSObject* owner, JSC::JSObject* value, JSDOMGlobalObject* globalObject)
-        : m_value(value)
-        , m_globalObject(globalObject)
-    {
-        ASSERT(value);
-        if (owner)
-            retain(owner);
-    }
-
-    ~JSDependentRetained()
-    {
-        release();
-    }
-
-    JSC::JSObject* get() const
-    {
-        return m_value.get();
-    }
-
-    bool isEmpty() const
-    {
-        return !m_owner || !m_value;
-    }
-
-    void retain(JSC::JSObject* owner)
-    {
-        ASSERT(!m_owner && owner);
-        ASSERT(m_value);
-        m_owner = JSC::PassWeak<JSC::JSObject>(owner);
-        m_owner->putDirect(m_globalObject->globalData(), m_propertyName, get());
-    }
-
-private:
-
-    void release()
-    {
-        if (m_owner)
-            m_owner->removeDirect(m_globalObject->globalData(), m_propertyName);
-        m_value.clear();
-        m_owner.clear();
-    }
-
-    JSC::Weak<JSC::JSObject> m_owner;
-    JSC::Weak<JSC::JSObject> m_value;
-    JSC::PrivateName m_propertyName;
-    JSC::Weak<JSDOMGlobalObject> m_globalObject;
-};
-
-} // namespace WebCore
-
-#endif // JSDependentRetained_h
diff --git a/Source/WebCore/bindings/v8/V8DependentRetained.h b/Source/WebCore/bindings/v8/V8DependentRetained.h
deleted file mode 100644 (file)
index 627700b..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All Rights Reserved.
- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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:
- * 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 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 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.
- */
-
-#ifndef V8DependentRetained_h
-#define V8DependentRetained_h
-
-#include "ScopedPersistent.h"
-#include "V8HiddenPropertyName.h"
-#include "V8PerIsolateData.h"
-#include <v8.h>
-#include <wtf/Forward.h>
-#include <wtf/UnusedParam.h>
-#include <wtf/dtoa.h>
-#include <wtf/text/StringBuilder.h>
-
-namespace WebCore {
-
-class V8DependentRetained {
-public:
-    V8DependentRetained(v8::Handle<v8::Object> owner, v8::Handle<v8::Object> value)
-        : m_value(value)
-        , m_propertyName(createPropertyName())
-    {
-        ASSERT(!m_value.isEmpty());
-        m_value.get().MakeWeak(this, &V8DependentRetained::weakCallback);
-        if (!owner.IsEmpty())
-            retain(owner);
-    }
-
-    ~V8DependentRetained()
-    {
-        release();
-    }
-
-    v8::Handle<v8::Object> get() const
-    {
-        return m_value.get();
-    }
-
-    bool isEmpty() const
-    {
-        return m_owner.isEmpty() || m_value.isEmpty();
-    }
-
-    void retain(v8::Handle<v8::Object> owner)
-    {
-        ASSERT(m_owner.isEmpty() && !owner.IsEmpty());
-        ASSERT(!m_value.isEmpty());
-        owner->SetHiddenValue(m_propertyName.get(), get());
-        m_owner.set(owner);
-        m_owner.get().MakeWeak(this, &V8DependentRetained::weakCallback);
-    }
-
-private:
-    static v8::Handle<v8::String> createPropertyName()
-    {
-        StringBuilder name;
-        name.appendLiteral("V8DependentRetained");
-        name.append(String::numberToStringECMAScript(V8PerIsolateData::current()->nextDependentRetainedId()));
-        return V8HiddenPropertyName::hiddenReferenceName(reinterpret_cast<const char*>(name.characters8()), name.length(), NewString);
-    }
-
-    static void weakCallback(v8::Persistent<v8::Value> object, void* parameter)
-    {
-        V8DependentRetained* value = static_cast<V8DependentRetained*>(parameter);
-        value->release();
-    }
-
-    void release()
-    {
-        if (!m_owner.isEmpty())
-            m_owner->DeleteHiddenValue(m_propertyName.get());
-        m_value.clear();
-        m_owner.clear();
-        m_propertyName.clear();
-    }
-
-    ScopedPersistent<v8::Object> m_owner;
-    ScopedPersistent<v8::Object> m_value;
-    ScopedPersistent<v8::String> m_propertyName;
-};
-
-} // namespace WebCore
-
-#endif // V8DependentRetained_h
index 29824b1..f3f4aff 100644 (file)
@@ -50,7 +50,6 @@ V8PerIsolateData::V8PerIsolateData(v8::Isolate* isolate)
     , m_hiddenPropertyName(adoptPtr(new V8HiddenPropertyName()))
     , m_constructorMode(ConstructorMode::CreateNewObject)
     , m_recursionLevel(0)
-    , m_nextDependentRetainedId(0)
 #ifndef NDEBUG
     , m_internalScriptRecursionLevel(0)
 #endif
index 7e96589..33cd849 100644 (file)
@@ -109,8 +109,6 @@ public:
     int incrementRecursionLevel() { return ++m_recursionLevel; }
     int decrementRecursionLevel() { return --m_recursionLevel; }
 
-    int nextDependentRetainedId() { return m_nextDependentRetainedId++; }
-
 #ifndef NDEBUG
     int internalScriptRecursionLevel() const { return m_internalScriptRecursionLevel; }
     int incrementInternalScriptRecursionLevel() { return ++m_internalScriptRecursionLevel; }
@@ -153,7 +151,6 @@ private:
     friend class ConstructorMode;
 
     int m_recursionLevel;
-    int m_nextDependentRetainedId;
 
 #ifndef NDEBUG
     int m_internalScriptRecursionLevel;