bool ScriptValueSerializerForModules::writeCryptoKey(v8::Local<v8::Value> value)
{
    CryptoKey* key = V8CryptoKey::toImpl(value.As<v8::Object>());
    if (!key)
        return false;
    return toSerializedScriptValueWriterForModules(writer()).writeCryptoKey(key->key());
}
ScriptValueSerializer::StateBase* ScriptValueSerializerForModules::writeDOMFileSystem(v8::Local<v8::Value> value, ScriptValueSerializer::StateBase* next)
{
    DOMFileSystem* fs = V8DOMFileSystem::toImpl(value.As<v8::Object>());
    if (!fs)
        return 0;
    if (!fs->clonable())
        return handleError(DataCloneError, "A FileSystem object could not be cloned.", next);

    toSerializedScriptValueWriterForModules(writer()).writeDOMFileSystem(fs->type(), fs->name(), fs->rootURL().string());
    return 0;
}
ScriptValueSerializer::StateBase*
ScriptValueSerializerForModules::writeRTCCertificate(v8::Local<v8::Value> value,
                                                     StateBase* next) {
  RTCCertificate* certificate =
      V8RTCCertificate::toImpl(value.As<v8::Object>());
  if (!certificate)
    return handleError(Status::DataCloneError,
                       "An RTCCertificate object could not be cloned.", next);
  toSerializedScriptValueWriterForModules(writer()).writeRTCCertificate(
      *certificate);
  return nullptr;
}