本文整理汇总了C++中WrapperMap类的典型用法代码示例。如果您正苦于以下问题:C++ WrapperMap类的具体用法?C++ WrapperMap怎么用?C++ WrapperMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WrapperMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: trace
void trace(JSTracer* trc) override {
CrossCompartmentKey prior = key;
if (key.debugger)
TraceManuallyBarrieredEdge(trc, &key.debugger, "CCW debugger");
if (key.kind == CrossCompartmentKey::ObjectWrapper ||
key.kind == CrossCompartmentKey::DebuggerObject ||
key.kind == CrossCompartmentKey::DebuggerEnvironment ||
key.kind == CrossCompartmentKey::DebuggerSource)
{
MOZ_ASSERT(IsInsideNursery(key.wrapped) ||
key.wrapped->asTenured().getTraceKind() == JS::TraceKind::Object);
TraceManuallyBarrieredEdge(trc, reinterpret_cast<JSObject**>(&key.wrapped),
"CCW wrapped object");
}
if (key.debugger == prior.debugger && key.wrapped == prior.wrapped)
return;
/* Look for the original entry, which might have been removed. */
WrapperMap::Ptr p = map->lookup(prior);
if (!p)
return;
/* Rekey the entry. */
map->rekeyAs(prior, key, key);
}
开发者ID:cbradley857,项目名称:gecko-dev,代码行数:25,代码来源:jscompartment.cpp
示例2: visitAllPyObjects
void BindingManager::visitAllPyObjects(ObjectVisitor visitor, void* data)
{
WrapperMap copy = m_d->wrapperMapper;
for (WrapperMap::iterator it = copy.begin(); it != copy.end(); ++it) {
if (hasWrapper(it->first))
visitor(it->second, data);
}
}
开发者ID:renatofilho,项目名称:Shiboken,代码行数:8,代码来源:bindingmanager.cpp
示例3: JSQuarantinedObjectWrapper
JSInspectedObjectWrapper::JSInspectedObjectWrapper(ExecState* unwrappedExec, JSObject* unwrappedObject, JSValue* wrappedPrototype)
: JSQuarantinedObjectWrapper(unwrappedExec, unwrappedObject, wrappedPrototype)
{
WrapperMap* wrapperMap = wrappers().get(unwrappedGlobalObject());
if (!wrapperMap) {
wrapperMap = new WrapperMap;
wrappers().set(unwrappedGlobalObject(), wrapperMap);
}
ASSERT(!wrapperMap->contains(unwrappedObject));
wrapperMap->set(unwrappedObject, this);
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:12,代码来源:JSInspectedObjectWrapper.cpp
示例4: ASSERT
JSInspectedObjectWrapper::~JSInspectedObjectWrapper()
{
ASSERT(wrappers().contains(unwrappedGlobalObject()));
WrapperMap* wrapperMap = wrappers().get(unwrappedGlobalObject());
ASSERT(wrapperMap->contains(unwrappedObject()));
wrapperMap->remove(unwrappedObject());
if (wrapperMap->isEmpty()) {
wrappers().remove(unwrappedGlobalObject());
delete wrapperMap;
}
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:13,代码来源:JSInspectedObjectWrapper.cpp
示例5: trace
void trace(JSTracer* trc) override {
CrossCompartmentKey prior = key;
key.applyToWrapped(TraceFunctor(trc, "ccw wrapped"));
key.applyToDebugger(TraceFunctor(trc, "ccw debugger"));
if (key == prior)
return;
/* Look for the original entry, which might have been removed. */
WrapperMap::Ptr p = map->lookup(prior);
if (!p)
return;
/* Rekey the entry. */
map->rekeyAs(prior, key, key);
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:15,代码来源:jscompartment.cpp
示例6: showWrapperMap
static void showWrapperMap(const WrapperMap& wrapperMap)
{
if (Py_VerboseFlag > 0) {
fprintf(stderr, "-------------------------------\n");
fprintf(stderr, "WrapperMap: %p (size: %d)\n", &wrapperMap, (int) wrapperMap.size());
WrapperMap::const_iterator iter;
for (iter = wrapperMap.begin(); iter != wrapperMap.end(); ++iter) {
fprintf(stderr, "key: %p, value: %p (%s, refcnt: %d)\n", iter->first,
iter->second,
Py_TYPE(iter->second)->tp_name,
(int) ((PyObject*)iter->second)->ob_refcnt);
}
fprintf(stderr, "-------------------------------\n");
}
}
开发者ID:renatofilho,项目名称:Shiboken,代码行数:15,代码来源:bindingmanager.cpp
示例7: GetWrapperMap
//--------------------------------------------------------------
/// Generates XML that describes the injected processes and which
/// plugins were injected.
/// \return string containing the XML
//--------------------------------------------------------------
gtASCIIString ProcessTracker::GetProcessesXML()
{
std::unordered_map< DWORD, gtASCIIString > procXMLMap;
this->UpdateListOfInjectedProcesses();
ProcessInfoList injectedProcesses = this->GetListOfInjectedProcesses();
WrapperMap wrappers = GetWrapperMap();
// the strPlatform is named this way to match options in the client.
#ifdef X64
gtASCIIString strPlatform = "Win64";
#else
gtASCIIString strPlatform = "Win32";
#endif
#ifndef CODEXL_GRAPHICS
if (injectedProcesses.empty() == true)
{
LogConsole(logERROR, "There are no processes running which have been injected with the GPU PerfStudio server plugin\n");
LogConsole(logERROR, "Please ensure that the server has the same bitness as the target application\n");
LogConsole(logERROR, "For example, use the 64-bit GPU PerfStudio server with a 64-bit application\n");
}
#endif
for (ProcessInfoList::iterator procIter = injectedProcesses.begin();
procIter != injectedProcesses.end();
++procIter)
{
DWORD pid = procIter->th32ProcessID;
// only add the process info if it wasn't already found.
if (procXMLMap.find(pid) == procXMLMap.end())
{
// insert new process and the process info
gtASCIIString tmpString = XML("Name", XMLEscape(procIter->szExeFile).asCharArray());
tmpString += XML("PID", pid);
tmpString += XML("Path", XMLEscape(procIter->szPath).asCharArray());
tmpString += XML("Platform", strPlatform.asCharArray());
procXMLMap[ pid ] = tmpString;
// if this process is the one that was launched, then we know what the args and working directory were.
// we could probably get the actual args and working dir from MicroDLL if it is a different app though, which
// would be the case if this app uses a launcher app.
if (m_injectedAppName.compare(procIter->szPath) == 0)
{
tmpString = XML("Args", XMLEscape(m_injectedAppArgs.c_str()).asCharArray());
tmpString += XML("WDir", XMLEscape(m_injectedAppDir.c_str()).asCharArray());
procXMLMap[ pid ] += tmpString.asCharArray();
}
}
// add an API node for each of the wrappers that are injected into the app
for (WrapperMap::const_iterator wrapperIter = wrappers.begin(); wrapperIter != wrappers.end(); ++wrapperIter)
{
// List of plugin extensions to check for. On Windows, test for 32 and 64 bit plugins.
// On linux, just check for the plugin corresponding to the server bitness
static const char* pluginExtensions[] =
{
#ifdef WIN32
GDT_DEBUG_SUFFIX GDT_BUILD_SUFFIX "." DLL_EXTENSION,
"-x64" GDT_DEBUG_SUFFIX GDT_BUILD_SUFFIX "." DLL_EXTENSION
#else
GDT_PROJECT_SUFFIX "." DLL_EXTENSION
#endif
};
int numPlugins = sizeof(pluginExtensions) / sizeof(pluginExtensions[0]);
for (int loop = 0; loop < numPlugins; loop++)
{
// check to see if this wrapper is in the application
gtASCIIString strPluginName = wrapperIter->second.strPluginName;
if (SG_GET_BOOL(OptionDllReplacement) == false)
{
strPluginName += pluginExtensions[loop];
}
if (IsLibraryLoadedInProcess(pid, strPluginName.asCharArray(), NULL))
{
bool attached = false;
if (g_activeWrappersMap.find(FormatText("%lu/%s", pid, wrapperIter->first.c_str()).asCharArray()) != g_activeWrappersMap.end())
{
// the pid/plugin string was listed in the active wrappers map, so the plugin must be active.
attached = true;
}
procXMLMap[pid] += XMLAttrib("API", FormatText("attached='%s'", attached ? "TRUE" : "FALSE").asCharArray(), wrapperIter->second.strPluginShortDesc.asCharArray());
}
//.........这里部分代码省略.........
开发者ID:StephenThomasUWTSD,项目名称:CodeXL,代码行数:101,代码来源:ProcessTracker.cpp
注:本文中的WrapperMap类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论