Exemplo n.º 1
0
void ResourceLoader::didSendData(unsigned long long, unsigned long long)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
}
Exemplo n.º 2
0
void ResourceLoader::didDownloadData(int length)
{
    if (!m_cancelled && !fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!m_cancelled && !fastMallocSize(documentLoader()->frame()))
        CRASH();
}
Exemplo n.º 3
0
void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    RefPtr<ResourceLoader> protector(this);

    ASSERT(!m_reachedTerminalState);

    if (m_options.sendLoadCallbacks == SendCallbacks) {
        if (!m_identifier) {
            m_identifier = m_frame->page()->progress()->createUniqueIdentifier();
            frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);
        }

        frameLoader()->notifier()->willSendRequest(this, request, redirectResponse);
    }

    if (!redirectResponse.isNull())
        resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url());
    m_request = request;
}
Exemplo n.º 4
0
void ResourceLoader::cannotShowURL(ResourceHandle*)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    didFail(cannotShowURLError());
}
Exemplo n.º 5
0
void ResourceLoader::wasBlocked(ResourceHandle*)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    didFail(blockedError());
}
Exemplo n.º 6
0
void ResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    didFinishLoading(finishTime);
}
Exemplo n.º 7
0
void ResourceLoader::didFail(ResourceHandle*, const ResourceError& error)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForError(this, error))
        return;
    didFail(error);
}
Exemplo n.º 8
0
bool ResourceLoader::shouldUseCredentialStorage()
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();

    if (m_options.allowCredentials == DoNotAllowStoredCredentials)
        return false;
    
    RefPtr<ResourceLoader> protector(this);
    return frameLoader()->client()->shouldUseCredentialStorage(documentLoader(), identifier());
}
Exemplo n.º 9
0
void ResourceLoader::willCacheResponse(ResourceHandle*, CacheStoragePolicy& policy)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    // <rdar://problem/7249553> - There are reports of crashes with this method being called
    // with a null m_frame->settings(), which can only happen if the frame doesn't have a page.
    // Sadly we have no reproducible cases of this.
    // We think that any frame without a page shouldn't have any loads happening in it, yet
    // there is at least one code path where that is not true.
    ASSERT(m_frame->settings());
    
    // When in private browsing mode, prevent caching to disk
    if (policy == StorageAllowed && m_frame->settings() && m_frame->settings()->privateBrowsingEnabled())
        policy = StorageAllowedInMemoryOnly;    
}
Exemplo n.º 10
0
void ResourceLoader::didReceiveResponse(const ResourceResponse& r)
{
    if (!fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!fastMallocSize(documentLoader()->frame()))
        CRASH();
    ASSERT(!m_reachedTerminalState);

    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    RefPtr<ResourceLoader> protector(this);

    m_response = r;

    if (FormData* data = m_request.httpBody())
        data->removeGeneratedFilesIfNeeded();
        
    if (m_options.sendLoadCallbacks == SendCallbacks)
        frameLoader()->notifier()->didReceiveResponse(this, m_response);
}
Exemplo n.º 11
0
void ResourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)
{
    if (!m_cancelled && !fastMallocSize(documentLoader()->applicationCacheHost()))
        CRASH();
    if (!m_cancelled && !fastMallocSize(documentLoader()->frame()))
        CRASH();
    // The following assertions are not quite valid here, since a subclass
    // might override didReceiveData in a way that invalidates them. This
    // happens with the steps listed in 3266216
    // ASSERT(con == connection);
    // ASSERT(!m_reachedTerminalState);

    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    RefPtr<ResourceLoader> protector(this);

    addData(data, length, allAtOnce);
    // FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
    // However, with today's computers and networking speeds, this won't happen in practice.
    // Could be an issue with a giant local file.
    if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
        frameLoader()->notifier()->didReceiveData(this, data, length, static_cast<int>(encodedDataLength));
}