Example #1
0
bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
{
    DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate);
    if (world && world->isIsolatedWorld())
        return world->isolatedWorldHasContentSecurityPolicy();
    return false;
}
Example #2
0
bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
{
    v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
    if (context.IsEmpty() || !toDOMWindow(context))
        return false;
    DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate);
    return world->isIsolatedWorld() ? world->isolatedWorldHasContentSecurityPolicy() : false;
}
Example #3
0
void V8XMLHttpRequest::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExecutionContext* context = currentExecutionContext(info.GetIsolate());

    RefPtr<SecurityOrigin> securityOrigin;
    if (context->isDocument()) {
        DOMWrapperWorld* world = DOMWrapperWorld::current(info.GetIsolate());
        if (world->isIsolatedWorld())
            securityOrigin = world->isolatedWorldSecurityOrigin();
    }

    RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);

    v8::Handle<v8::Object> wrapper = info.Holder();
    V8DOMWrapper::associateObjectWithWrapper<V8XMLHttpRequest>(xmlHttpRequest.release(), &wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
    info.GetReturnValue().Set(wrapper);
}