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


C++ AtomicString::utf8方法代码示例

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


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

示例1: setMode

void SourceBuffer::setMode(const AtomicString& newMode, ExceptionState& exceptionState)
{
    WTF_LOG(Media, "SourceBuffer::setMode %p newMode=%s", this, newMode.utf8().data());
    // Section 3.1 On setting mode attribute steps.
    // 1. Let new mode equal the new value being assigned to this attribute.
    // 2. If this object has been removed from the sourceBuffers attribute of the parent media source, then throw
    //    an INVALID_STATE_ERR exception and abort these steps.
    // 3. If the updating attribute equals true, then throw an INVALID_STATE_ERR exception and abort these steps.
    if (throwExceptionIfRemovedOrUpdating(isRemoved(), m_updating, exceptionState))
        return;

    // 4. If the readyState attribute of the parent media source is in the "ended" state then run the following steps:
    // 4.1 Set the readyState attribute of the parent media source to "open"
    // 4.2 Queue a task to fire a simple event named sourceopen at the parent media source.
    m_source->openIfInEndedState();

    // 5. If the append state equals PARSING_MEDIA_SEGMENT, then throw an INVALID_STATE_ERR and abort these steps.
    // 6. If the new mode equals "sequence", then set the group start timestamp to the highest presentation end timestamp.
    WebSourceBuffer::AppendMode appendMode = WebSourceBuffer::AppendModeSegments;
    if (newMode == sequenceKeyword())
        appendMode = WebSourceBuffer::AppendModeSequence;
    if (!m_webSourceBuffer->setMode(appendMode)) {
        MediaSource::logAndThrowDOMException(exceptionState, InvalidStateError, "The mode may not be set while the SourceBuffer's append state is 'PARSING_MEDIA_SEGMENT'.");
        return;
    }

    // 7. Update the attribute to new mode.
    m_mode = newMode;
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:29,代码来源:SourceBuffer.cpp

示例2: namedPropertyGetter

static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Value>& info) {
  const CString& nameInUtf8 = name.utf8();
  ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestInterface2", nameInUtf8.data());

  TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
  TestInterfaceEmpty* result = impl->namedItem(name, exceptionState);
  if (!result)
    return;
  v8SetReturnValueFast(info, result, impl);
}
开发者ID:mirror,项目名称:chromium,代码行数:10,代码来源:V8TestInterface2.cpp

示例3: namedPropertyQuery

static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
  const CString& nameInUtf8 = name.utf8();
  ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "TestSpecialOperations", nameInUtf8.data());

  TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder());

  bool result = impl->namedPropertyQuery(name, exceptionState);
  if (!result)
    return;
  v8SetReturnValueInt(info, v8::None);
}
开发者ID:mirror,项目名称:chromium,代码行数:11,代码来源:V8TestSpecialOperations.cpp

示例4: namedPropertyDeleter

static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Boolean>& info) {
  const CString& nameInUtf8 = name.utf8();
  ExceptionState exceptionState(info.GetIsolate(), ExceptionState::DeletionContext, "TestInterface2", nameInUtf8.data());

  TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());

  DeleteResult result = impl->deleteNamedItem(name, exceptionState);
  if (exceptionState.hadException())
    return;
  if (result == DeleteUnknownProperty)
    return;
  v8SetReturnValue(info, result == DeleteSuccess);
}
开发者ID:mirror,项目名称:chromium,代码行数:13,代码来源:V8TestInterface2.cpp

示例5: namedPropertySetter

static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
  const CString& nameInUtf8 = name.utf8();
  ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "TestInterface2", nameInUtf8.data());

  TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
  TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
  if (!propertyValue && !isUndefinedOrNull(v8Value)) {
    exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
    return;
  }

  bool result = impl->setNamedItem(name, propertyValue, exceptionState);
  if (exceptionState.hadException())
    return;
  if (!result)
    return;
  v8SetReturnValue(info, v8Value);
}
开发者ID:mirror,项目名称:chromium,代码行数:18,代码来源:V8TestInterface2.cpp

示例6: RefDefault

sk_sp<SkTypeface> FontCache::createTypeface(
    const FontDescription& fontDescription,
    const FontFaceCreationParams& creationParams,
    CString& name) {
  AtomicString family = creationParams.family();

  if (family.isEmpty()) {
    name = getFallbackFontFamily(fontDescription).string().utf8();
  } else {
    name = family.utf8();
  }

  fonts::FontRequest request;
  request.family = name.data();
  request.weight = ToIntegerWeight(fontDescription.weight());
  request.width = static_cast<uint32_t>(fontDescription.stretch());
  request.slant = ToFontSlant(fontDescription.style());

  fonts::FontResponsePtr response;
  auto& font_provider = GetFontProvider();
  font_provider->GetFont(
      std::move(request),
      [&response](fonts::FontResponsePtr r) { response = std::move(r); });
  font_provider.WaitForResponse();

  FXL_DCHECK(response)
      << "Unable to contact the font provider. Did you run "
         "Flutter in an environment that has a font manager?\n"
         "See <https://fuchsia.googlesource.com/modular/+/master/README.md>.";

  if (!response)
    return nullptr;

  sk_sp<SkData> data = MakeSkDataFromBuffer(response->data.buffer);
  if (!data)
    return nullptr;

  return SkFontMgr::RefDefault()->makeFromData(std::move(data));
}
开发者ID:HansMuller,项目名称:engine,代码行数:39,代码来源:FontCacheFuchsia.cpp


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