diff options
Diffstat (limited to 'WebCore/bindings/js')
-rw-r--r-- | WebCore/bindings/js/IDBBindingUtilities.cpp | 4 | ||||
-rw-r--r-- | WebCore/bindings/js/IDBBindingUtilities.h | 6 | ||||
-rw-r--r-- | WebCore/bindings/js/JSBindingsAllInOne.cpp | 6 | ||||
-rw-r--r-- | WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp (renamed from WebCore/bindings/js/JSMimeTypeArrayCustom.cpp) | 12 | ||||
-rw-r--r-- | WebCore/bindings/js/JSDOMPluginArrayCustom.cpp (renamed from WebCore/bindings/js/JSPluginArrayCustom.cpp) | 12 | ||||
-rw-r--r-- | WebCore/bindings/js/JSDOMPluginCustom.cpp (renamed from WebCore/bindings/js/JSPluginCustom.cpp) | 12 | ||||
-rw-r--r-- | WebCore/bindings/js/JSIDBAnyCustom.cpp | 7 | ||||
-rw-r--r-- | WebCore/bindings/js/JSSharedWorkerCustom.cpp | 5 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptCallStack.cpp | 2 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptCallStack.h | 5 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptController.h | 12 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptDebugServer.cpp | 6 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptEventListener.cpp | 8 | ||||
-rw-r--r-- | WebCore/bindings/js/ScriptEventListener.h | 4 |
14 files changed, 51 insertions, 50 deletions
diff --git a/WebCore/bindings/js/IDBBindingUtilities.cpp b/WebCore/bindings/js/IDBBindingUtilities.cpp index faa2370..638a23e 100644 --- a/WebCore/bindings/js/IDBBindingUtilities.cpp +++ b/WebCore/bindings/js/IDBBindingUtilities.cpp @@ -26,10 +26,10 @@ #include "config.h" #include "IDBBindingUtilities.h" -#include "IDBKey.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBKey.h" + namespace WebCore { PassRefPtr<IDBKey> createIDBKeyFromValue(JSC::ExecState* exec, JSC::JSValue value) diff --git a/WebCore/bindings/js/IDBBindingUtilities.h b/WebCore/bindings/js/IDBBindingUtilities.h index 0a2fb790..f410344 100644 --- a/WebCore/bindings/js/IDBBindingUtilities.h +++ b/WebCore/bindings/js/IDBBindingUtilities.h @@ -26,11 +26,11 @@ #ifndef IDBBindingUtilities_h #define IDBBindingUtilities_h -#include "ScriptValue.h" -#include <wtf/PassRefPtr.h> - #if ENABLE(INDEXED_DATABASE) +#include "ScriptValue.h" +#include <wtf/Forward.h> + namespace WebCore { class IDBKey; diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp index c9a77fb..373c0e0 100644 --- a/WebCore/bindings/js/JSBindingsAllInOne.cpp +++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp @@ -97,7 +97,7 @@ #include "JSMessageChannelCustom.cpp" #include "JSMessageEventCustom.cpp" #include "JSMessagePortCustom.cpp" -#include "JSMimeTypeArrayCustom.cpp" +#include "JSDOMMimeTypeArrayCustom.cpp" #include "JSNamedNodeMapCustom.cpp" #include "JSNavigatorCustom.cpp" #include "JSNodeCustom.cpp" @@ -106,8 +106,8 @@ #include "JSNodeIteratorCustom.cpp" #include "JSNodeListCustom.cpp" #include "JSOptionConstructor.cpp" -#include "JSPluginArrayCustom.cpp" -#include "JSPluginCustom.cpp" +#include "JSDOMPluginArrayCustom.cpp" +#include "JSDOMPluginCustom.cpp" #include "JSPluginElementFunctions.cpp" #include "JSPopStateEventCustom.cpp" #include "JSSQLResultSetRowListCustom.cpp" diff --git a/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp b/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp index bdd6ddb..2d41843 100644 --- a/WebCore/bindings/js/JSMimeTypeArrayCustom.cpp +++ b/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp @@ -18,24 +18,24 @@ */ #include "config.h" -#include "JSMimeTypeArray.h" +#include "JSDOMMimeTypeArray.h" #include "AtomicString.h" -#include "JSMimeType.h" -#include "MimeTypeArray.h" +#include "DOMMimeTypeArray.h" +#include "JSDOMMimeType.h" namespace WebCore { using namespace JSC; -bool JSMimeTypeArray::canGetItemsForName(ExecState*, MimeTypeArray* mimeTypeArray, const Identifier& propertyName) +bool JSDOMMimeTypeArray::canGetItemsForName(ExecState*, DOMMimeTypeArray* mimeTypeArray, const Identifier& propertyName) { return mimeTypeArray->canGetItemsForName(identifierToAtomicString(propertyName)); } -JSValue JSMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) +JSValue JSDOMMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) { - JSMimeTypeArray* thisObj = static_cast<JSMimeTypeArray*>(asObject(slotBase)); + JSDOMMimeTypeArray* thisObj = static_cast<JSDOMMimeTypeArray*>(asObject(slotBase)); return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName))); } diff --git a/WebCore/bindings/js/JSPluginArrayCustom.cpp b/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp index b232f4d..abf3148 100644 --- a/WebCore/bindings/js/JSPluginArrayCustom.cpp +++ b/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp @@ -18,24 +18,24 @@ */ #include "config.h" -#include "JSPluginArray.h" +#include "JSDOMPluginArray.h" #include "AtomicString.h" -#include "JSPlugin.h" -#include "PluginArray.h" +#include "DOMPluginArray.h" +#include "JSDOMPlugin.h" namespace WebCore { using namespace JSC; -bool JSPluginArray::canGetItemsForName(ExecState*, PluginArray* pluginArray, const Identifier& propertyName) +bool JSDOMPluginArray::canGetItemsForName(ExecState*, DOMPluginArray* pluginArray, const Identifier& propertyName) { return pluginArray->canGetItemsForName(identifierToAtomicString(propertyName)); } -JSValue JSPluginArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) +JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) { - JSPluginArray* thisObj = static_cast<JSPluginArray*>(asObject(slotBase)); + JSDOMPluginArray* thisObj = static_cast<JSDOMPluginArray*>(asObject(slotBase)); return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName))); } diff --git a/WebCore/bindings/js/JSPluginCustom.cpp b/WebCore/bindings/js/JSDOMPluginCustom.cpp index 9fa0b76..c8d187e 100644 --- a/WebCore/bindings/js/JSPluginCustom.cpp +++ b/WebCore/bindings/js/JSDOMPluginCustom.cpp @@ -17,24 +17,24 @@ */ #include "config.h" -#include "JSPlugin.h" +#include "JSDOMPlugin.h" #include "AtomicString.h" -#include "JSMimeType.h" -#include "Plugin.h" +#include "DOMPlugin.h" +#include "JSDOMMimeType.h" namespace WebCore { using namespace JSC; -bool JSPlugin::canGetItemsForName(ExecState*, Plugin* plugin, const Identifier& propertyName) +bool JSDOMPlugin::canGetItemsForName(ExecState*, DOMPlugin* plugin, const Identifier& propertyName) { return plugin->canGetItemsForName(identifierToAtomicString(propertyName)); } -JSValue JSPlugin::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) +JSValue JSDOMPlugin::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName) { - JSPlugin* thisObj = static_cast<JSPlugin*>(asObject(slotBase)); + JSDOMPlugin* thisObj = static_cast<JSDOMPlugin*>(asObject(slotBase)); return toJS(exec, thisObj->impl()->namedItem(identifierToAtomicString(propertyName))); } diff --git a/WebCore/bindings/js/JSIDBAnyCustom.cpp b/WebCore/bindings/js/JSIDBAnyCustom.cpp index 43a79a2..b7c845e 100644 --- a/WebCore/bindings/js/JSIDBAnyCustom.cpp +++ b/WebCore/bindings/js/JSIDBAnyCustom.cpp @@ -11,9 +11,6 @@ * 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 @@ -37,10 +34,12 @@ #include "IDBAny.h" #include "IDBDatabaseRequest.h" #include "IDBIndexRequest.h" +#include "IDBKey.h" #include "IDBObjectStoreRequest.h" #include "IndexedDatabaseRequest.h" #include "JSIDBDatabaseRequest.h" #include "JSIDBIndexRequest.h" +#include "JSIDBKey.h" #include "JSIDBObjectStoreRequest.h" #include "JSIndexedDatabaseRequest.h" #include "SerializedScriptValue.h" @@ -63,6 +62,8 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, IDBAny* idbAny) return toJS(exec, globalObject, idbAny->idbDatabaseRequest()); case IDBAny::IDBIndexRequestType: return toJS(exec, globalObject, idbAny->idbIndexRequest()); + case IDBAny::IDBKeyType: + return toJS(exec, globalObject, idbAny->idbKey()); case IDBAny::IDBObjectStoreRequestType: return toJS(exec, globalObject, idbAny->idbObjectStoreRequest()); case IDBAny::IndexedDatabaseRequestType: diff --git a/WebCore/bindings/js/JSSharedWorkerCustom.cpp b/WebCore/bindings/js/JSSharedWorkerCustom.cpp index 261ae2b..0d576e0 100644 --- a/WebCore/bindings/js/JSSharedWorkerCustom.cpp +++ b/WebCore/bindings/js/JSSharedWorkerCustom.cpp @@ -70,7 +70,10 @@ EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker( DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl(); ExceptionCode ec = 0; RefPtr<SharedWorker> worker = SharedWorker::create(ustringToString(scriptURL), ustringToString(name), window->document(), ec); - setDOMException(exec, ec); + if (ec) { + setDOMException(exec, ec); + return JSValue::encode(JSValue()); + } return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release()))); } diff --git a/WebCore/bindings/js/ScriptCallStack.cpp b/WebCore/bindings/js/ScriptCallStack.cpp index 86ddcd1..c9bb8b0 100644 --- a/WebCore/bindings/js/ScriptCallStack.cpp +++ b/WebCore/bindings/js/ScriptCallStack.cpp @@ -100,7 +100,7 @@ void ScriptCallStack::initialize() m_initialized = true; } -bool ScriptCallStack::stackTrace(int, ScriptState*, ScriptArray&) +bool ScriptCallStack::stackTrace(int, const RefPtr<InspectorArray>&) { return false; } diff --git a/WebCore/bindings/js/ScriptCallStack.h b/WebCore/bindings/js/ScriptCallStack.h index 6cf7679..e461ac3 100644 --- a/WebCore/bindings/js/ScriptCallStack.h +++ b/WebCore/bindings/js/ScriptCallStack.h @@ -36,6 +36,7 @@ #include "ScriptState.h" #include "ScriptString.h" #include <wtf/Noncopyable.h> +#include <wtf/RefPtr.h> namespace JSC { class ExecState; @@ -44,6 +45,8 @@ namespace JSC { namespace WebCore { + class InspectorArray; + class ScriptCallStack : public Noncopyable { public: ScriptCallStack(JSC::ExecState*, unsigned skipArgumentCount = 0); @@ -54,7 +57,7 @@ namespace WebCore { // frame retrieval methods const ScriptCallFrame &at(unsigned); unsigned size(); - static bool stackTrace(int, ScriptState*, ScriptArray&); + static bool stackTrace(int, const RefPtr<InspectorArray>&); private: void initialize(); diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h index 0debf39..c382a93 100644 --- a/WebCore/bindings/js/ScriptController.h +++ b/WebCore/bindings/js/ScriptController.h @@ -23,6 +23,7 @@ #define ScriptController_h #include "JSDOMWindowShell.h" +#include "ScriptControllerBase.h" #include "ScriptInstance.h" #include <runtime/Protect.h> #include <wtf/RefPtr.h> @@ -62,17 +63,6 @@ class XSSAuditor; typedef HashMap<void*, RefPtr<JSC::Bindings::RootObject> > RootObjectMap; -enum ReasonForCallingCanExecuteScripts { - AboutToExecuteScript, - NotAboutToExecuteScript -}; - -// Whether to call the XSSAuditor to audit a script before passing it to the JavaScript engine. -enum ShouldAllowXSS { - AllowXSS, - DoNotAllowXSS -}; - class ScriptController { friend class ScriptCachedFrameData; typedef WTF::HashMap< RefPtr<DOMWrapperWorld>, JSC::ProtectedPtr<JSDOMWindowShell> > ShellMap; diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp index d1b5112..0a40f13 100644 --- a/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/WebCore/bindings/js/ScriptDebugServer.cpp @@ -568,7 +568,11 @@ void ScriptDebugServer::recompileAllJSFunctionsSoon() void ScriptDebugServer::recompileAllJSFunctions(Timer<ScriptDebugServer>*) { JSLock lock(SilenceAssertionsOnly); - Debugger::recompileAllJSFunctions(JSDOMWindow::commonJSGlobalData()); + // If JavaScript stack is not empty postpone recompilation. + if (JSDOMWindow::commonJSGlobalData()->dynamicGlobalObject) + recompileAllJSFunctionsSoon(); + else + Debugger::recompileAllJSFunctions(JSDOMWindow::commonJSGlobalData()); } void ScriptDebugServer::didAddListener(Page* page) diff --git a/WebCore/bindings/js/ScriptEventListener.cpp b/WebCore/bindings/js/ScriptEventListener.cpp index 467f16b..d2baf82 100644 --- a/WebCore/bindings/js/ScriptEventListener.cpp +++ b/WebCore/bindings/js/ScriptEventListener.cpp @@ -105,18 +105,18 @@ PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame* frame, Attri return JSLazyEventListener::create(attr->localName().string(), eventParameterName(frame->document()->isSVGDocument()), attr->value(), 0, sourceURL, lineNumber, wrapper, mainThreadNormalWorld()); } -String eventListenerHandlerBody(ScriptExecutionContext* context, ScriptState* scriptState, EventListener* eventListener) +String eventListenerHandlerBody(Document* document, EventListener* eventListener) { const JSEventListener* jsListener = JSEventListener::cast(eventListener); if (!jsListener) return ""; - JSC::JSObject* jsFunction = jsListener->jsFunction(context); + JSC::JSObject* jsFunction = jsListener->jsFunction(document); if (!jsFunction) return ""; - return ustringToString(jsFunction->toString(scriptState)); + return ustringToString(jsFunction->toString(scriptStateFromNode(jsListener->isolatedWorld(), document))); } -bool eventListenerHandlerLocation(ScriptExecutionContext*, ScriptState*, EventListener*, String&, int&) +bool eventListenerHandlerLocation(Document*, EventListener*, String&, int&) { // FIXME: Add support for getting function location. return false; diff --git a/WebCore/bindings/js/ScriptEventListener.h b/WebCore/bindings/js/ScriptEventListener.h index f1f203c..f96f31e 100644 --- a/WebCore/bindings/js/ScriptEventListener.h +++ b/WebCore/bindings/js/ScriptEventListener.h @@ -45,8 +45,8 @@ namespace WebCore { PassRefPtr<JSLazyEventListener> createAttributeEventListener(Node*, Attribute*); PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame*, Attribute*); - String eventListenerHandlerBody(ScriptExecutionContext*, ScriptState*, EventListener*); - bool eventListenerHandlerLocation(ScriptExecutionContext*, ScriptState*, EventListener*, String& sourceName, int& lineNumber); + String eventListenerHandlerBody(Document*, EventListener*); + bool eventListenerHandlerLocation(Document*, EventListener*, String& sourceName, int& lineNumber); } // namespace WebCore #endif // ScriptEventListener_h |