当前位置: 首页>>代码示例>>C++>>正文


C++ JSDOMWindow::globalObject方法代码示例

本文整理汇总了C++中JSDOMWindow::globalObject方法的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMWindow::globalObject方法的具体用法?C++ JSDOMWindow::globalObject怎么用?C++ JSDOMWindow::globalObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSDOMWindow的用法示例。


在下文中一共展示了JSDOMWindow::globalObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: jsDOMWindowWebKit

static EncodedJSValue jsDOMWindowWebKit(ExecState* exec, EncodedJSValue thisValue, PropertyName)
{
    JSDOMWindow* castedThis = toJSDOMWindow(JSValue::decode(thisValue));
    if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->wrapped()))
        return JSValue::encode(jsUndefined());
    return JSValue::encode(toJS(exec, castedThis->globalObject(), castedThis->wrapped().webkitNamespace()));
}
开发者ID:ollie314,项目名称:webkit,代码行数:7,代码来源:JSDOMWindowCustom.cpp

示例2: setWindow

void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
    // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
    // so we'd better never try to.
    ASSERT(!window() || domWindow.get() != &window()->impl());
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)

    //VMOLAB
    //printf("JSDOMWindowShell::setWindow Called\n");
    
    VM& vm = JSDOMWindow::commonVM();
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
    Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, domWindow, this);
    prototype->structure()->setGlobalObject(vm, jsDOMWindow);
    setWindow(vm, jsDOMWindow);
    ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
    ASSERT(prototype->globalObject() == jsDOMWindow);
#if ENABLE(VMOLAB)
    vm.setInParallelParseLoad(true);
#endif
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:26,代码来源:JSDOMWindowShell.cpp

示例3: setWindow

void JSDOMWindowShell::setWindow(RefPtr<DOMWindow>&& domWindow)
{
    // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
    // so we'd better never try to.
    ASSERT(!window() || domWindow.get() != &window()->wrapped());
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)
    
    VM& vm = JSDOMWindow::commonVM();
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
    Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, *domWindow, this);
    prototype->structure()->setGlobalObject(vm, jsDOMWindow);

    Structure* windowPropertiesStructure = JSDOMWindowProperties::createStructure(vm, jsDOMWindow, JSEventTarget::prototype(vm, jsDOMWindow));
    JSDOMWindowProperties* windowProperties = JSDOMWindowProperties::create(windowPropertiesStructure, *jsDOMWindow);

    prototype->structure()->setPrototypeWithoutTransition(vm, windowProperties);
    setWindow(vm, jsDOMWindow);
    ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
    ASSERT(prototype->globalObject() == jsDOMWindow);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:25,代码来源:JSDOMWindowShell.cpp

示例4: setWindow

void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
{
    // Replacing JSDOMWindow via telling JSDOMWindowShell to use the same DOMWindow it already uses makes no sense,
    // so we'd better never try to.
    ASSERT(!window() || domWindow.get() != window()->impl());
    // Explicitly protect the global object's prototype so it isn't collected
    // when we allocate the global object. (Once the global object is fully
    // constructed, it can mark its own prototype.)
    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(*JSDOMWindow::commonVM(), 0, jsNull());
    Strong<JSDOMWindowPrototype> prototype(*JSDOMWindow::commonVM(), JSDOMWindowPrototype::create(*JSDOMWindow::commonVM(), 0, prototypeStructure));

    Structure* structure = JSDOMWindow::createStructure(*JSDOMWindow::commonVM(), 0, prototype.get());
    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(*JSDOMWindow::commonVM(), structure, domWindow, this);
    prototype->structure()->setGlobalObject(*JSDOMWindow::commonVM(), jsDOMWindow);
    setWindow(*JSDOMWindow::commonVM(), jsDOMWindow);
    ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
    ASSERT(prototype->globalObject() == jsDOMWindow);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:18,代码来源:JSDOMWindowShell.cpp


注:本文中的JSDOMWindow::globalObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。