예제 #1
0
void DumpRenderTreeSupportEfl::sendWebIntentResponse(Ewk_Intent_Request* request, JSStringRef response)
{
#if ENABLE(WEB_INTENTS)
    JSC::UString responseString = response->ustring();
    if (responseString.isNull())
        ewk_intent_request_failure_post(request, WebCore::SerializedScriptValue::create(String::fromUTF8("ERROR")));
    else
        ewk_intent_request_result_post(request, WebCore::SerializedScriptValue::create(String(responseString.impl())));
#endif
}
예제 #2
0
PassRefPtr<StringImpl> StringImpl::create(const JSC::UString& str)
{
    SharedUChar* sharedBuffer = const_cast<JSC::UString*>(&str)->rep()->sharedBuffer();
    if (sharedBuffer) {
        PassRefPtr<StringImpl> impl = adoptRef(new StringImpl(const_cast<UChar*>(str.data()), str.size(), AdoptBuffer()));
        sharedBuffer->ref();
        impl->m_sharedBufferAndFlags.set(sharedBuffer);
        return impl;
    }
    return StringImpl::create(str.data(), str.size());
}
예제 #3
0
void Console::profile(const JSC::UString& title, ScriptCallStack* callStack)
{
    Page* page = this->page();
    if (!page)
        return;

#if ENABLE(INSPECTOR)
    InspectorController* controller = page->inspectorController();
    // FIXME: log a console message when profiling is disabled.
    if (!controller->profilerEnabled())
        return;
#endif

    JSC::UString resolvedTitle = title;
    if (title.isNull())   // no title so give it the next user initiated profile title.
#if ENABLE(INSPECTOR)
        resolvedTitle = controller->getCurrentUserInitiatedProfileName(true);
#else
        resolvedTitle = "";
#endif

    JSC::Profiler::profiler()->startProfiling(callStack->state(), resolvedTitle);

#if ENABLE(INSPECTOR)
    const ScriptCallFrame& lastCaller = callStack->at(0);
    controller->addStartProfilingMessageToConsole(resolvedTitle, lastCaller.lineNumber(), lastCaller.sourceURL());
#endif
}
static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec, JSC::JSObject *callee,
                                                           JSC::JSValue thisValue, const JSC::ArgList &args)
{
    QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
    thisValue = engine->toUsableValue(thisValue);
    if (!thisValue.inherits(&QScriptObject::info))
        return throwError(exec, JSC::TypeError, "This object is not a QVariant");
    QScriptObjectDelegate *delegate = static_cast<QScriptObject*>(JSC::asObject(thisValue))->delegate();
    if (!delegate || (delegate->type() != QScriptObjectDelegate::Variant))
        return throwError(exec, JSC::TypeError, "This object is not a QVariant");
    const QVariant &v = static_cast<QVariantDelegate*>(delegate)->value();
    JSC::UString result;
    JSC::JSValue value = variantProtoFuncValueOf(exec, callee, thisValue, args);
    if (value.isObject()) {
        result = v.toString();
        if (result.isEmpty() && !v.canConvert(QVariant::String))
            result = QString::fromLatin1("QVariant(%0)").arg(QString::fromLatin1(v.typeName()));
    } else {
        result = value.toString(exec);
    }
    return JSC::jsString(exec, result);
}
예제 #5
0
파일: Console.cpp 프로젝트: Fale/qtmoko
void Console::profile(const JSC::UString& title, ScriptCallStack* callStack)
{
    Page* page = this->page();
    if (!page)
        return;

    if (title.isNull())
        return;

    // FIXME: log a console message when profiling is disabled.
    if (!page->inspectorController()->profilerEnabled())
        return;

    JSC::Profiler::profiler()->startProfiling(callStack->state(), title);
}