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


C++ StaticRefPtr::GetMessageLoop方法代码示例

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


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

示例1: DispatchReleaseImageClient

// static
void ImageBridgeChild::DispatchReleaseImageClient(ImageClient* aClient,
                                                  PImageContainerChild* aChild)
{
  if (!aClient && !aChild) {
    return;
  }

  if (!IsCreated()) {
    if (aClient) {
      // CompositableClient::Release should normally happen in the ImageBridgeChild
      // thread because it usually generate some IPDL messages.
      // However, if we take this branch it means that the ImageBridgeChild
      // has already shut down, along with the CompositableChild, which means no
      // message will be sent and it is safe to run this code from any thread.
      MOZ_ASSERT(aClient->GetIPDLActor() == nullptr);
      aClient->Release();
    }
    delete aChild;
    return;
  }

  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&ReleaseImageClientNow, aClient, aChild));
}
开发者ID:Jinwoo-Song,项目名称:gecko-dev,代码行数:26,代码来源:ImageBridgeChild.cpp

示例2: DispatchImageClientUpdate

//static
void ImageBridgeChild::DispatchImageClientUpdate(ImageClient* aClient,
                                                 ImageContainer* aContainer)
{
  if (InImageBridgeChildThread()) {
    UpdateImageClientNow(aClient, aContainer);
    return;
  }
  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction<
      void (*)(ImageClient*, ImageContainer*),
      ImageClient*,
      nsRefPtr<ImageContainer> >(&UpdateImageClientNow, aClient, aContainer));
}
开发者ID:adamroach,项目名称:gecko-dev,代码行数:15,代码来源:ImageBridgeChild.cpp

示例3: FlushAllImages

//static
void ImageBridgeChild::FlushAllImages(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront)
{
  MOZ_ASSERT(aClient);
  MOZ_ASSERT(!InImageBridgeChildThread());
  if (InImageBridgeChildThread()) {
    NS_ERROR("ImageBridgeChild::FlushAllImages() is called on ImageBridge thread.");
     return;
   }

  RefPtr<AsyncTransactionTracker> status = aClient->PrepareFlushAllImages();

  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, status));

  status->WaitComplete();
}
开发者ID:adamroach,项目名称:gecko-dev,代码行数:18,代码来源:ImageBridgeChild.cpp

示例4: DispatchImageClientUpdate

// static
void ImageBridgeChild::DispatchImageClientUpdate(ImageClient* aClient,
                                                 ImageContainer* aContainer)
{
  if (!ImageBridgeChild::IsCreated() || ImageBridgeChild::IsShutDown()) {
    NS_WARNING("Something is holding on to graphics resources after the shutdown"
               "of the graphics subsystem!");
    return;
  }
  if (!aClient || !aContainer || !IsCreated()) {
    return;
  }

  if (InImageBridgeChildThread()) {
    UpdateImageClientNow(aClient, aContainer);
    return;
  }
  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&UpdateImageClientNow, aClient, RefPtr<ImageContainer>(aContainer)));
}
开发者ID:Eroppo,项目名称:cyberfox-beta,代码行数:21,代码来源:ImageBridgeChild.cpp

示例5: FlushAllImages

//static
void ImageBridgeChild::FlushAllImages(ImageClient* aClient, ImageContainer* aContainer, bool aExceptFront)
{
  if (InImageBridgeChildThread()) {
    FlushAllImagesNow(aClient, aContainer, aExceptFront);
    return;
  }

  ReentrantMonitor barrier("CreateImageClient Lock");
  ReentrantMonitorAutoEnter autoMon(barrier);
  bool done = false;

  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, aExceptFront, &barrier, &done));

  // should stop the thread until the ImageClient has been created on
  // the other thread
  while (!done) {
    barrier.Wait();
  }
}
开发者ID:micadeyeye,项目名称:gecko-dev,代码行数:22,代码来源:ImageBridgeChild.cpp

示例6: UpdateAsyncCanvasRenderer

// static
void ImageBridgeChild::UpdateAsyncCanvasRenderer(AsyncCanvasRenderer* aWrapper)
{
  aWrapper->GetCanvasClient()->UpdateAsync(aWrapper);

  if (InImageBridgeChildThread()) {
    UpdateAsyncCanvasRendererNow(aWrapper);
    return;
  }

  ReentrantMonitor barrier("UpdateAsyncCanvasRenderer Lock");
  ReentrantMonitorAutoEnter autoMon(barrier);
  bool done = false;

  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&UpdateAsyncCanvasRendererSync, aWrapper, &barrier, &done));

  // should stop the thread until the CanvasClient has been created on
  // the other thread
  while (!done) {
    barrier.Wait();
  }
}
开发者ID:Eroppo,项目名称:cyberfox-beta,代码行数:24,代码来源:ImageBridgeChild.cpp

示例7: FlushAllImages

//static
void ImageBridgeChild::FlushAllImages(ImageClient* aClient,
                                      ImageContainer* aContainer)
{
  if (!IsCreated()) {
    return;
  }
  MOZ_ASSERT(aClient);
  MOZ_ASSERT(!sImageBridgeChildSingleton->mShuttingDown);
  MOZ_ASSERT(!InImageBridgeChildThread());
  if (InImageBridgeChildThread()) {
    NS_ERROR("ImageBridgeChild::FlushAllImages() is called on ImageBridge thread.");
    return;
  }

  RefPtr<AsyncTransactionWaiter> waiter = new AsyncTransactionWaiter();
  // This increment is balanced by the decrement in FlushAllImagesSync
  waiter->IncrementWaitCount();

  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&FlushAllImagesSync, aClient, aContainer, waiter));

  waiter->WaitComplete();
}
开发者ID:Jinwoo-Song,项目名称:gecko-dev,代码行数:25,代码来源:ImageBridgeChild.cpp

示例8: DispatchReleaseTextureClient

// static
void ImageBridgeChild::DispatchReleaseTextureClient(TextureClient* aClient)
{
  sImageBridgeChildSingleton->GetMessageLoop()->PostTask(
    FROM_HERE,
    NewRunnableFunction(&ReleaseTextureClientNow, aClient));
}
开发者ID:adamroach,项目名称:gecko-dev,代码行数:7,代码来源:ImageBridgeChild.cpp


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