Пример #1
0
ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff)
    : d(adoptPtr(new ResourceHandleInternal(this, context, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()))))
{
    if (!request.url().isValid()) {
        scheduleFailure(InvalidURLFailure);
        return;
    }

    if (!portAllowed(request.url())) {
        scheduleFailure(BlockedFailure);
        return;
    }
}
Пример #2
0
void
Work::advance()
{
    if (getState() != WORK_PENDING)
    {
        return;
    }

    CLOG(DEBUG, "Work") << "advancing " << getUniqueName();
    advanceChildren();
    if (allChildrenSuccessful())
    {
        CLOG(DEBUG, "Work") << "all " << mChildren.size() << " children of "
                            << getUniqueName() << " successful, scheduling run";
        scheduleRun();
    }
    else if (anyChildFatalFailure())
    {
        CLOG(DEBUG, "Work") << "some of " << mChildren.size() << " children of "
                            << getUniqueName() << " fatally failed, scheduling "
                            << "fatal failure";
        scheduleFatalFailure();
    }
    else if (anyChildRaiseFailure())
    {
        CLOG(DEBUG, "Work") << "some of " << mChildren.size() << " children of "
                            << getUniqueName() << " failed, scheduling failure";
        scheduleFailure();
    }
}
bool ResourceHandle::start()
{
    if (!d->m_context || !d->m_context->isValid())
        return false;

    // FIXME: clean up use of Frame now that we have NetworkingContext (see RIM Bug #1515)
    Frame* frame = static_cast<FrameNetworkingContextBlackBerry*>(d->m_context.get())->frame();
    if (!frame || !frame->loader() || !frame->loader()->client() || !client())
        return false;
    int playerId = static_cast<FrameLoaderClientBlackBerry*>(frame->loader()->client())->playerId();
    if (NetworkManager::instance()->startJob(playerId, this, frame, d->m_defersLoading) != BlackBerry::Platform::FilterStream::StatusSuccess)
        scheduleFailure(InvalidURLFailure);
    return true;
}
Пример #4
0
void
ApplyLedgerChainWork::onRun()
{
    try
    {
        if (!applyHistoryOfSingleLedger())
        {
            mCurrSeq += mApp.getHistoryManager().getCheckpointFrequency();
            openCurrentInputFiles();
        }
        scheduleSuccess();
    }
    catch (std::runtime_error& e)
    {
        CLOG(ERROR, "History") << "Replay failed: " << e.what();
        scheduleFailure();
    }
}
Пример #5
0
void
NtpWork::onNtpClientFailure()
{
    scheduleFailure();
}