HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImportLoader* loader, HTMLImport* parent, HTMLImportChildClient* client)
{
    HTMLImport::SyncMode mode = client->isSync() && !makesCycle(parent, url) ? HTMLImport::Sync : HTMLImport::Async;
    if (mode == HTMLImport::Async)
        UseCounter::count(root()->document(), UseCounter::HTMLImportsAsyncAttribute);

    OwnPtrWillBeRawPtr<HTMLImportChild> child = adoptPtrWillBeNoop(new HTMLImportChild(url, loader, mode));
    child->setClient(client);
    parent->appendImport(child.get());
    loader->addImport(child.get());
    return root()->add(child.release());
}