summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSDOMWindowCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSDOMWindowCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSDOMWindowCustom.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 4b5f386..562e661 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -108,7 +108,7 @@ void JSDOMWindow::defineSetter(ExecState* exec, const Identifier& propertyName,
Base::defineSetter(exec, propertyName, setterFunction);
}
-JSValue* JSDOMWindow::lookupGetter(ExecState* exec, const Identifier& propertyName)
+JSValuePtr JSDOMWindow::lookupGetter(ExecState* exec, const Identifier& propertyName)
{
// Only allow looking-up getters by frames in the same origin.
if (!allowsAccessFrom(exec))
@@ -116,7 +116,7 @@ JSValue* JSDOMWindow::lookupGetter(ExecState* exec, const Identifier& propertyNa
return Base::lookupGetter(exec, propertyName);
}
-JSValue* JSDOMWindow::lookupSetter(ExecState* exec, const Identifier& propertyName)
+JSValuePtr JSDOMWindow::lookupSetter(ExecState* exec, const Identifier& propertyName)
{
// Only allow looking-up setters by frames in the same origin.
if (!allowsAccessFrom(exec))
@@ -124,7 +124,7 @@ JSValue* JSDOMWindow::lookupSetter(ExecState* exec, const Identifier& propertyNa
return Base::lookupSetter(exec, propertyName);
}
-void JSDOMWindow::setLocation(ExecState* exec, JSValue* value)
+void JSDOMWindow::setLocation(ExecState* exec, JSValuePtr value)
{
Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
if (!activeFrame)
@@ -144,20 +144,20 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue* value)
if (!activeFrame->loader()->shouldAllowNavigation(impl()->frame()))
return;
- String dstUrl = activeFrame->loader()->completeURL(value->toString(exec)).string();
+ String dstUrl = activeFrame->loader()->completeURL(value.toString(exec)).string();
if (!protocolIs(dstUrl, "javascript") || allowsAccessFrom(exec)) {
bool userGesture = activeFrame->script()->processingUserGesture();
// We want a new history item if this JS was called via a user gesture
- impl()->frame()->loader()->scheduleLocationChange(dstUrl, activeFrame->loader()->outgoingReferrer(), false, userGesture);
+ impl()->frame()->loader()->scheduleLocationChange(dstUrl, activeFrame->loader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
}
}
-JSValue* JSDOMWindow::postMessage(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::postMessage(ExecState* exec, const ArgList& args)
{
DOMWindow* window = impl();
DOMWindow* source = asJSDOMWindow(exec->dynamicGlobalObject())->impl();
- String message = args.at(exec, 0)->toString(exec);
+ String message = args.at(exec, 0).toString(exec);
if (exec->hadException())
return jsUndefined();
@@ -175,52 +175,52 @@ JSValue* JSDOMWindow::postMessage(ExecState* exec, const ArgList& args)
return jsUndefined();
}
-static JSValue* setTimeoutOrInterval(ExecState* exec, JSDOMWindow* window, const ArgList& args, bool timeout)
+static JSValuePtr setTimeoutOrInterval(ExecState* exec, JSDOMWindow* window, const ArgList& args, bool timeout)
{
- JSValue* v = args.at(exec, 0);
- int delay = args.at(exec, 1)->toInt32(exec);
- if (v->isString())
+ JSValuePtr v = args.at(exec, 0);
+ int delay = args.at(exec, 1).toInt32(exec);
+ if (v.isString())
return jsNumber(exec, window->installTimeout(asString(v)->value(), delay, timeout));
CallData callData;
- if (v->getCallData(callData) == CallTypeNone)
+ if (v.getCallData(callData) == CallTypeNone)
return jsUndefined();
ArgList argsTail;
args.getSlice(2, argsTail);
return jsNumber(exec, window->installTimeout(exec, v, argsTail, delay, timeout));
}
-JSValue* JSDOMWindow::setTimeout(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::setTimeout(ExecState* exec, const ArgList& args)
{
return setTimeoutOrInterval(exec, this, args, true);
}
-JSValue* JSDOMWindow::clearTimeout(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::clearTimeout(ExecState* exec, const ArgList& args)
{
- removeTimeout(args.at(exec, 0)->toInt32(exec));
+ removeTimeout(args.at(exec, 0).toInt32(exec));
return jsUndefined();
}
-JSValue* JSDOMWindow::setInterval(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::setInterval(ExecState* exec, const ArgList& args)
{
return setTimeoutOrInterval(exec, this, args, false);
}
-JSValue* JSDOMWindow::clearInterval(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::clearInterval(ExecState* exec, const ArgList& args)
{
- removeTimeout(args.at(exec, 0)->toInt32(exec));
+ removeTimeout(args.at(exec, 0).toInt32(exec));
return jsUndefined();
}
-JSValue* JSDOMWindow::atob(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::atob(ExecState* exec, const ArgList& args)
{
if (args.size() < 1)
return throwError(exec, SyntaxError, "Not enough arguments");
- JSValue* v = args.at(exec, 0);
- if (v->isNull())
+ JSValuePtr v = args.at(exec, 0);
+ if (v.isNull())
return jsEmptyString(exec);
- UString s = v->toString(exec);
+ UString s = v.toString(exec);
if (!s.is8Bit()) {
setDOMException(exec, INVALID_CHARACTER_ERR);
return jsUndefined();
@@ -237,16 +237,16 @@ JSValue* JSDOMWindow::atob(ExecState* exec, const ArgList& args)
return jsString(exec, String(out.data(), out.size()));
}
-JSValue* JSDOMWindow::btoa(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::btoa(ExecState* exec, const ArgList& args)
{
if (args.size() < 1)
return throwError(exec, SyntaxError, "Not enough arguments");
- JSValue* v = args.at(exec, 0);
- if (v->isNull())
+ JSValuePtr v = args.at(exec, 0);
+ if (v.isNull())
return jsEmptyString(exec);
- UString s = v->toString(exec);
+ UString s = v.toString(exec);
if (!s.is8Bit()) {
setDOMException(exec, INVALID_CHARACTER_ERR);
return jsUndefined();
@@ -262,7 +262,7 @@ JSValue* JSDOMWindow::btoa(ExecState* exec, const ArgList& args)
return jsString(exec, String(out.data(), out.size()));
}
-JSValue* JSDOMWindow::addEventListener(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::addEventListener(ExecState* exec, const ArgList& args)
{
Frame* frame = impl()->frame();
if (!frame)
@@ -270,13 +270,13 @@ JSValue* JSDOMWindow::addEventListener(ExecState* exec, const ArgList& args)
if (RefPtr<JSEventListener> listener = findOrCreateJSEventListener(exec, args.at(exec, 1))) {
if (Document* doc = frame->document())
- doc->addWindowEventListener(AtomicString(args.at(exec, 0)->toString(exec)), listener.release(), args.at(exec, 2)->toBoolean(exec));
+ doc->addWindowEventListener(AtomicString(args.at(exec, 0).toString(exec)), listener.release(), args.at(exec, 2).toBoolean(exec));
}
return jsUndefined();
}
-JSValue* JSDOMWindow::removeEventListener(ExecState* exec, const ArgList& args)
+JSValuePtr JSDOMWindow::removeEventListener(ExecState* exec, const ArgList& args)
{
Frame* frame = impl()->frame();
if (!frame)
@@ -284,15 +284,15 @@ JSValue* JSDOMWindow::removeEventListener(ExecState* exec, const ArgList& args)
if (JSEventListener* listener = findJSEventListener(args.at(exec, 1))) {
if (Document* doc = frame->document())
- doc->removeWindowEventListener(AtomicString(args.at(exec, 0)->toString(exec)), listener, args.at(exec, 2)->toBoolean(exec));
+ doc->removeWindowEventListener(AtomicString(args.at(exec, 0).toString(exec)), listener, args.at(exec, 2).toBoolean(exec));
}
return jsUndefined();
}
-DOMWindow* toDOMWindow(JSValue* value)
+DOMWindow* toDOMWindow(JSValuePtr value)
{
- if (!value->isObject())
+ if (!value.isObject())
return 0;
JSObject* object = asObject(value);
if (object->inherits(&JSDOMWindow::s_info))
@@ -302,22 +302,22 @@ DOMWindow* toDOMWindow(JSValue* value)
return 0;
}
-JSValue* nonCachingStaticCloseFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr nonCachingStaticCloseFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
{
return new (exec) PrototypeFunction(exec, 0, propertyName, jsDOMWindowPrototypeFunctionClose);
}
-JSValue* nonCachingStaticBlurFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr nonCachingStaticBlurFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
{
return new (exec) PrototypeFunction(exec, 0, propertyName, jsDOMWindowPrototypeFunctionBlur);
}
-JSValue* nonCachingStaticFocusFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr nonCachingStaticFocusFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
{
return new (exec) PrototypeFunction(exec, 0, propertyName, jsDOMWindowPrototypeFunctionFocus);
}
-JSValue* nonCachingStaticPostMessageFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr nonCachingStaticPostMessageFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot&)
{
return new (exec) PrototypeFunction(exec, 2, propertyName, jsDOMWindowPrototypeFunctionPostMessage);
}