Title: [129961] trunk/Source/WebCore
- Revision
- 129961
- Author
- [email protected]
- Date
- 2012-09-28 16:41:58 -0700 (Fri, 28 Sep 2012)
Log Message
Remove Instance::setDidExecuteFunction
https://bugs.webkit.org/show_bug.cgi?id=97952
Reviewed by Alexey Proskuryakov.
Instance::setDidExecuteFunction was added over 8 years ago to fix a bug where Objective-C
DOM calls weren't updating the document correctly. Nowadays we correctly invalidate the DOM tree
when these calls are made so we don't need an extra step to do so.
* bindings/js/ScriptControllerMac.mm:
(WebCore):
(WebCore::ScriptController::initJavaJSBindings):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject valueForKey:]):
(-[WebScriptObject removeWebScriptKey:]):
(-[WebScriptObject hasWebScriptKey:]):
(-[WebScriptObject stringRepresentation]):
(-[WebScriptObject webScriptValueAtIndex:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
* bridge/jsc/BridgeJSC.cpp:
* bridge/jsc/BridgeJSC.h:
(Instance):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (129960 => 129961)
--- trunk/Source/WebCore/ChangeLog 2012-09-28 23:38:48 UTC (rev 129960)
+++ trunk/Source/WebCore/ChangeLog 2012-09-28 23:41:58 UTC (rev 129961)
@@ -1,3 +1,31 @@
+2012-09-28 Anders Carlsson <[email protected]>
+
+ Remove Instance::setDidExecuteFunction
+ https://bugs.webkit.org/show_bug.cgi?id=97952
+
+ Reviewed by Alexey Proskuryakov.
+
+ Instance::setDidExecuteFunction was added over 8 years ago to fix a bug where Objective-C
+ DOM calls weren't updating the document correctly. Nowadays we correctly invalidate the DOM tree
+ when these calls are made so we don't need an extra step to do so.
+
+ * bindings/js/ScriptControllerMac.mm:
+ (WebCore):
+ (WebCore::ScriptController::initJavaJSBindings):
+ * bindings/objc/WebScriptObject.mm:
+ (-[WebScriptObject callWebScriptMethod:withArguments:]):
+ (-[WebScriptObject evaluateWebScript:]):
+ (-[WebScriptObject setValue:forKey:]):
+ (-[WebScriptObject valueForKey:]):
+ (-[WebScriptObject removeWebScriptKey:]):
+ (-[WebScriptObject hasWebScriptKey:]):
+ (-[WebScriptObject stringRepresentation]):
+ (-[WebScriptObject webScriptValueAtIndex:]):
+ (-[WebScriptObject setWebScriptValueAtIndex:value:]):
+ * bridge/jsc/BridgeJSC.cpp:
+ * bridge/jsc/BridgeJSC.h:
+ (Instance):
+
2012-09-28 Emil A Eklund <[email protected]>
Improve saturation arithmetic support in FractionalLayoutUnit
Modified: trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm (129960 => 129961)
--- trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm 2012-09-28 23:38:48 UTC (rev 129960)
+++ trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm 2012-09-28 23:41:58 UTC (rev 129961)
@@ -138,32 +138,9 @@
#if ENABLE(JAVA_BRIDGE)
-static pthread_t mainThread;
-
-static void updateStyleIfNeededForBindings(JSC::ExecState*, JSC::JSObject* rootObject)
-{
- if (pthread_self() != mainThread)
- return;
-
- if (!rootObject)
- return;
-
- JSDOMWindow* window = JSC::jsCast<JSDOMWindow*>(rootObject);
- if (!window)
- return;
-
- Frame* frame = window->impl()->frame();
- if (!frame)
- return;
-
- frame->document()->updateStyleIfNeeded();
-}
-
void ScriptController::initJavaJSBindings()
{
- mainThread = pthread_self();
JSC::Bindings::JavaJSObject::initializeJNIThreading();
- JSC::Bindings::Instance::setDidExecuteFunction(updateStyleIfNeededForBindings);
}
#endif
Modified: trunk/Source/WebCore/bindings/objc/WebScriptObject.mm (129960 => 129961)
--- trunk/Source/WebCore/bindings/objc/WebScriptObject.mm 2012-09-28 23:38:48 UTC (rev 129960)
+++ trunk/Source/WebCore/bindings/objc/WebScriptObject.mm 2012-09-28 23:41:58 UTC (rev 129961)
@@ -140,19 +140,6 @@
return WebCore::createJSWrapper(toJS(jsObject), originRootObject, rootObject);
}
-static void _didExecute(WebScriptObject *obj)
-{
- RootObject* root = [obj _rootObject];
- if (!root)
- return;
-
- ExecState* exec = root->globalObject()->globalExec();
- ASSERT(exec->globalData().apiLock().currentThreadIsHoldingLock());
- KJSDidExecuteFunctionPtr func = Instance::didExecuteFunction();
- if (func)
- func(exec, root->globalObject());
-}
-
- (void)_setImp:(JSObject*)imp originRootObject:(PassRefPtr<RootObject>)originRootObject rootObject:(PassRefPtr<RootObject>)rootObject
{
// This function should only be called once, as a (possibly lazy) initializer.
@@ -340,8 +327,6 @@
// Convert and return the result of the function call.
id resultObj = [WebScriptObject _convertValueToObjcValue:result originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
- _didExecute(self);
-
return resultObj;
}
@@ -361,8 +346,6 @@
id resultObj = [WebScriptObject _convertValueToObjcValue:returnValue originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
- _didExecute(self);
-
return resultObj;
}
@@ -383,8 +366,6 @@
addExceptionToConsole(exec);
exec->clearException();
}
-
- _didExecute(self);
}
- (id)valueForKey:(NSString *)key
@@ -416,9 +397,6 @@
if ([resultObj isKindOfClass:[WebUndefined class]])
resultObj = [super valueForKey:key]; // defaults to throwing an exception
- JSLockHolder lock(exec);
- _didExecute(self);
-
return resultObj;
}
@@ -437,8 +415,6 @@
addExceptionToConsole(exec);
exec->clearException();
}
-
- _didExecute(self);
}
- (BOOL)hasWebScriptKey:(NSString *)key
@@ -457,8 +433,6 @@
exec->clearException();
}
- _didExecute(self);
-
return result;
}
@@ -476,8 +450,6 @@
NSString *description = [result description];
- _didExecute(self);
-
return description;
}
@@ -500,8 +472,6 @@
id resultObj = [WebScriptObject _convertValueToObjcValue:result originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
- _didExecute(self);
-
return resultObj;
}
@@ -520,8 +490,6 @@
addExceptionToConsole(exec);
exec->clearException();
}
-
- _didExecute(self);
}
- (void)setException:(NSString *)description
Modified: trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp (129960 => 129961)
--- trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp 2012-09-28 23:38:48 UTC (rev 129960)
+++ trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp 2012-09-28 23:41:58 UTC (rev 129961)
@@ -63,18 +63,6 @@
ASSERT(!m_runtimeObject);
}
-static KJSDidExecuteFunctionPtr s_didExecuteFunction;
-
-void Instance::setDidExecuteFunction(KJSDidExecuteFunctionPtr func)
-{
- s_didExecuteFunction = func;
-}
-
-KJSDidExecuteFunctionPtr Instance::didExecuteFunction()
-{
- return s_didExecuteFunction;
-}
-
void Instance::begin()
{
virtualBegin();
Modified: trunk/Source/WebCore/bridge/jsc/BridgeJSC.h (129960 => 129961)
--- trunk/Source/WebCore/bridge/jsc/BridgeJSC.h 2012-09-28 23:38:48 UTC (rev 129960)
+++ trunk/Source/WebCore/bridge/jsc/BridgeJSC.h 2012-09-28 23:41:58 UTC (rev 129961)
@@ -69,15 +69,10 @@
virtual ~Class() { }
};
-typedef void (*KJSDidExecuteFunctionPtr)(ExecState*, JSObject* rootObject);
-
class Instance : public RefCounted<Instance> {
public:
Instance(PassRefPtr<RootObject>);
- static void setDidExecuteFunction(KJSDidExecuteFunctionPtr func);
- static KJSDidExecuteFunctionPtr didExecuteFunction();
-
// These functions are called before and after the main entry points into
// the native implementations. They can be used to establish and cleanup
// any needed state.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes