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


C++ JSLocation::impl方法代码示例

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


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

示例1: jsLocationOrigin

JSValue jsLocationOrigin(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    Location* imp = static_cast<Location*>(castedThis->impl());
    JSValue result = jsString(exec, imp->origin());
#ifdef JSC_TAINTED
    TaintedCounter* counter = TaintedCounter::getInstance();
    unsigned int tainted = counter->getCount();
    result.setTainted(tainted);

    TaintedStructure trace_struct;
    trace_struct.taintedno = tainted;
    trace_struct.internalfunc = "jsLocationOrigin";
    trace_struct.jsfunc = "location.origin";
    trace_struct.action = "source";

    char msg[20];
    stringstream msgss;
    snprintf(msg, 20, "%s", result.toString(exec).utf8(true).data());
    msgss << msg;
    msgss >> trace_struct.value;

    TaintedTrace* trace = TaintedTrace::getInstance();
    trace->addTaintedTrace(trace_struct);
#endif
    return result;
}
开发者ID:dmitris,项目名称:tpjs,代码行数:28,代码来源:JSLocation.cpp

示例2: isReachableFromOpaqueRoots

bool JSLocationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSLocation* jsLocation = static_cast<JSLocation*>(handle.get().asCell());
    if (!isObservable(jsLocation))
        return false;
    Frame* root = jsLocation->impl()->frame();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
开发者ID:dmitris,项目名称:tpjs,代码行数:10,代码来源:JSLocation.cpp

示例3: jsLocationPrototypeFunctionGetParameter

EncodedJSValue JSC_HOST_CALL jsLocationPrototypeFunctionGetParameter(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSLocation::s_info))
        return throwVMTypeError(exec);
    JSLocation* castedThis = static_cast<JSLocation*>(asObject(thisValue));
    Location* imp = static_cast<Location*>(castedThis->impl());
    const String& name(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = jsString(exec, imp->getParameter(name));
    return JSValue::encode(result);
}
开发者ID:dmitris,项目名称:tpjs,代码行数:15,代码来源:JSLocation.cpp

示例4: setJSLocationHash

void setJSLocationHash(ExecState* exec, JSObject* thisObject, JSValue value)
{
#ifdef JSC_TAINTED
    unsigned int tainted = 0;
    if (value.isString() && value.isTainted()) {
	tainted = value.isTainted();
    }
    if (value.inherits(&StringObject::s_info) && asStringObject(value)->isTainted()) {
	tainted = asStringObject(value)->isTainted();
    }
    if (value.isObject()) {
        UString s = value.toString(exec);
        if (s.isTainted()) {
		tainted = s.isTainted();
	}
    }
    if (tainted) {
        JSLocation* castedThis = static_cast<JSLocation*>(thisObject);
	Location* imp = static_cast<Location*>(castedThis->impl());
        imp->frame()->document()->setTainted(tainted);

	TaintedStructure trace_struct;
	trace_struct.taintedno = tainted;
	trace_struct.internalfunc = "setJSLocationHash";
	trace_struct.jsfunc = "location.hash";
	trace_struct.action = "sink";

	char msg[20];
	stringstream msgss;
	snprintf(msg, 20, "%s", value.toString(exec).utf8(true).data());
	msgss << msg;
	msgss >> trace_struct.value;

	TaintedTrace* trace = TaintedTrace::getInstance();
	trace->addTaintedTrace(trace_struct);
    }
#endif
    static_cast<JSLocation*>(thisObject)->setHash(exec, value);
}
开发者ID:dmitris,项目名称:tpjs,代码行数:39,代码来源:JSLocation.cpp

示例5: finalize

void JSLocationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSLocation* jsLocation = static_cast<JSLocation*>(handle.get().asCell());
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, jsLocation->impl(), jsLocation);
}
开发者ID:dmitris,项目名称:tpjs,代码行数:6,代码来源:JSLocation.cpp


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