C++ Builder::ArrayPush方法代码示例(c++builder:arraypush方法的典型用法代码示例)

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


C++ Builder::ArrayPush方法代码示例(c++builder:arraypush方法的典型用法代码示例)

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

示例1: BuildJSObject

void TableTicker::BuildJSObject(Builder& b, typename Builder::ObjectHandle profile)
{
  // Put shared library info
  b.DefineProperty(profile, "libs", GetSharedLibraryInfoString().c_str());

  // Put meta data
  typename Builder::RootedObject meta(b.context(), GetMetaJSCustomObject(b));
  b.DefineProperty(profile, "meta", meta);

  // Lists the samples for each ThreadProfile
  typename Builder::RootedArray threads(b.context(), b.CreateArray());
  b.DefineProperty(profile, "threads", threads);

  SetPaused(true);

  {
    mozilla::MutexAutoLock lock(*sRegisteredThreadsMutex);

    for (size_t i = 0; i < sRegisteredThreads->size(); i++) {
      // Thread not being profiled, skip it
      if (!sRegisteredThreads->at(i)->Profile())
        continue;

      MutexAutoLock lock(*sRegisteredThreads->at(i)->Profile()->GetMutex());

      typename Builder::RootedObject threadSamples(b.context(), b.CreateObject());
      sRegisteredThreads->at(i)->Profile()->BuildJSObject(b, threadSamples);
      b.ArrayPush(threads, threadSamples);
    }
  }

#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
  if (ProfileJava()) {
    AndroidBridge::Bridge()->PauseJavaProfiling();

    typename Builder::RootedObject javaThread(b.context(), BuildJavaThreadJSObject(b));
    b.ArrayPush(threads, javaThread);

    AndroidBridge::Bridge()->UnpauseJavaProfiling();
  }
#endif

  SetPaused(false);

  // Send a event asking any subprocesses (plugins) to
  // give us their information
  SubprocessClosure<Builder> closure(&b, threads);
  nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
  if (os) {
    nsRefPtr<ProfileSaveEvent> pse = new ProfileSaveEvent(SubProcessCallback<Builder>, &closure);
    os->NotifyObservers(pse, "profiler-subprocess", nullptr);
  }
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例2: BuildJavaThreadJSObject

static
typename Builder::Object BuildJavaThreadJSObject(Builder& b)
{
  typename Builder::RootedObject javaThread(b.context(), b.CreateObject());
  b.DefineProperty(javaThread, "name", "Java Main Thread");

  typename Builder::RootedArray samples(b.context(), b.CreateArray());
  b.DefineProperty(javaThread, "samples", samples);

  int sampleId = 0;
  while (true) {
    int frameId = 0;
    typename Builder::RootedObject sample(b.context());
    typename Builder::RootedArray frames(b.context());
    while (true) {
      nsCString result;
      bool hasFrame = AndroidBridge::Bridge()->GetFrameNameJavaProfiling(0, sampleId, frameId, result);
      if (!hasFrame) {
        if (frames) {
          b.DefineProperty(sample, "frames", frames);
        }
        break;
      }
      if (!sample) {
        sample = b.CreateObject();
        frames = b.CreateArray();
        b.DefineProperty(sample, "frames", frames);
        b.ArrayPush(samples, sample);

        double sampleTime = AndroidBridge::Bridge()->GetSampleTimeJavaProfiling(0, sampleId);
        b.DefineProperty(sample, "time", sampleTime);
      }
      typename Builder::RootedObject frame(b.context(), b.CreateObject());
      b.DefineProperty(frame, "location", result.BeginReading());
      b.ArrayPush(frames, frame);
      frameId++;
    }
    if (frameId == 0) {
      break;
    }
    sampleId++;
  }

  return javaThread;
}
开发者ID:,项目名称:,代码行数:45,代码来源:

示例3: marker

template<typename Builder> void
ProfilerMarker::BuildJSObject(Builder& b, typename Builder::ArrayHandle markers) const {
  typename Builder::RootedObject marker(b.context(), b.CreateObject());
  b.DefineProperty(marker, "name", GetMarkerName());
  // TODO: Store the callsite for this marker if available:
  // if have location data
  //   b.DefineProperty(marker, "location", ...);
  if (mPayload) {
    typename Builder::RootedObject markerData(b.context(),
                                              mPayload->PreparePayload(b));
    b.DefineProperty(marker, "data", markerData);
  }
  b.ArrayPush(markers, marker);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

本文标签属性:

示例:示例英语

代码:代码零九

Builder:builder发音

ArrayPush:ArrayPush

上一篇:酒店邀请环卫工避雨(酒店邀请环卫工避雨怎么说)(海口五源河体育馆下雨怎么办?)
下一篇:千万富翁英文(大家说千万富翁的时候,是说有家产千万还是说年赚千万?)(multimillionaire千万富翁的5个解答)

为您推荐