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


C++ nsCOMArray::AppendElement方法代码示例

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


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

示例1:

void
inDOMView::AppendKidsToArray(nsINodeList* aKids,
                             nsCOMArray<nsIDOMNode>& aArray)
{
  for (uint32_t i = 0, len = aKids->Length(); i < len; ++i) {
    nsIContent* kid = aKids->Item(i);
    uint16_t nodeType = kid->NodeType();

    NS_ASSERTION(nodeType && nodeType <= nsINode::NOTATION_NODE,
                 "Unknown node type. "
                 "Were new types added to the spec?");
    // As of DOM Level 2 Core and Traversal, each NodeFilter constant
    // is defined as the lower nth bit in the NodeFilter bitmask,
    // where n is the numeric constant of the nodeType it represents.
    // If this invariant ever changes, we will need to update the
    // following line.
    uint32_t filterForNodeType = 1 << (nodeType - 1);

    if (mWhatToShow & filterForNodeType) {
      if ((nodeType == nsINode::TEXT_NODE ||
           nodeType == nsINode::COMMENT_NODE) &&
          !mShowWhitespaceNodes) {
        nsCOMPtr<nsIContent> content = do_QueryInterface(kid);
        auto data = static_cast<nsGenericDOMDataNode*>(content.get());
        NS_ASSERTION(data, "Does not implement nsIDOMCharacterData!");
        if (InspectorUtils::IsIgnorableWhitespace(*data)) {
          continue;
        }
      }

      nsCOMPtr<nsIDOMNode> node = do_QueryInterface(kid);
      aArray.AppendElement(node.forget());
    }
  }
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:35,代码来源:inDOMView.cpp

示例2: ImportStats

bool
nsPerformanceSnapshot::IterPerformanceStatsCallbackInternal(JSContext* cx, const js::PerformanceData& stats, const uint64_t uid) {
  nsCOMPtr<nsIPerformanceStats> result = ImportStats(cx, stats, uid);
  if (result) {
    mComponentsData.AppendElement(result);
  }

  return true;
}
开发者ID:hoosteeno,项目名称:gecko-dev,代码行数:9,代码来源:nsPerformanceStats.cpp

示例3: ImportStats

bool
nsPerformanceSnapshot::IterPerformanceStatsCallbackInternal(JSContext* cx,
                                                            const js::PerformanceData& stats, const uint64_t id,
                                                            const uint64_t* parentId) {

  nsCOMPtr<nsIPerformanceStats> parent = parentId ? mCachedStats.Get(*parentId) : nullptr;
  nsCOMPtr<nsIPerformanceStats> result = ImportStats(cx, stats, id, parent);
  if (result) {
    mComponentsData.AppendElement(result);
    mCachedStats.Put(id, result);
  }

  return true;
}
开发者ID:rhelmer,项目名称:gecko-dev,代码行数:14,代码来源:nsPerformanceStats.cpp

示例4: monitor

void
XPTInterfaceInfoManager::GetScriptableInterfaces(nsCOMArray<nsIInterfaceInfo>& aInterfaces)
{
    // I didn't want to incur the size overhead of using nsHashtable just to
    // make building an enumerator easier. So, this code makes a snapshot of
    // the table using an nsISupportsArray and builds an enumerator for that.
    // We can afford this transient cost.

    ReentrantMonitorAutoEnter monitor(mWorkingSet.mTableReentrantMonitor);
    aInterfaces.SetCapacity(mWorkingSet.mNameTable.Count());
    for (auto iter = mWorkingSet.mNameTable.Iter(); !iter.Done(); iter.Next()) {
        xptiInterfaceEntry* entry = iter.UserData();
        if (entry->GetScriptableFlag()) {
            nsCOMPtr<nsIInterfaceInfo> ii = entry->InterfaceInfo();
            aInterfaces.AppendElement(ii);
        }
    }
}
开发者ID:Jar-win,项目名称:Waterfox,代码行数:18,代码来源:xptiInterfaceInfoManager.cpp

示例5:

void
nsPerformanceSnapshot::AppendComponentsStats(nsIPerformanceStats* stats)
{
  mComponentsData.AppendElement(stats);
}
开发者ID:logicoftekk,项目名称:cyberfox,代码行数:5,代码来源:nsPerformanceStats.cpp


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