本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}