void HTMLResourcePreloader::takeAndPreload(PreloadRequestStream& r)
{
    PreloadRequestStream requests;
    requests.swap(r);

    for (PreloadRequestStream::iterator it = requests.begin(); it != requests.end(); ++it)
        preload(it->release());
}
Пример #2
0
 void fetchPreloads(PreloadRequestStream& preloads) override {
   PreloadRequestStream movedPreloads;
   movedPreloads.swap(preloads);
   for (PreloadRequestStream::iterator it = movedPreloads.begin();
        it != movedPreloads.end(); ++it) {
     m_preloads.append(std::move(*it));
   }
 }
void ResourcePreloader::takeAndPreload(PreloadRequestStream& r)
{
    PreloadRequestStream requests;
    NetworkHintsInterfaceImpl networkHintsInterface;
    requests.swap(r);

    for (PreloadRequestStream::iterator it = requests.begin(); it != requests.end(); ++it)
        preload(it->release(), networkHintsInterface);
}
static void checkThatPreloadsAreSafeToSendToAnotherThread(const PreloadRequestStream& preloads)
{
    for (size_t i = 0; i < preloads.size(); ++i)
        ASSERT(preloads[i]->isSafeToSendToAnotherThread());
}