void ResourceResponse::setTextEncodingName(const String& encodingName)
{
    updateResourceResponse();
    m_isNull = false;
    
    m_textEncodingName = encodingName; 
}
void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length)
{
    if (!enabled())
        return;

    InspectorResource* resource = new InspectorResource(m_nextIdentifier--, loader, loader->frame());
    resource->finished = true;

    updateResourceRequest(resource, request);
    updateResourceResponse(resource, response);

    resource->length = length;
    resource->cached = true;
    resource->startTime = currentTime();
    resource->responseReceivedTime = resource->startTime;
    resource->endTime = resource->startTime;

    if (loader->frame() == m_inspectedPage->mainFrame() && request.url() == loader->requestURL())
        m_mainResource = resource;

    addResource(resource);

    if (windowVisible())
        addAndUpdateScriptResource(resource);
}
void ResourceResponse::setSuggestedFilename(const String& suggestedName)
{
    updateResourceResponse();
    m_isNull = false;
    
    m_suggestedFilename = suggestedName; 
}
void ResourceResponse::setUrl(const KURL& url)
{
    updateResourceResponse();
    m_isNull = false;
    
    m_url = url; 
}
void ResourceResponse::setMimeType(const String& mimeType)
{
    updateResourceResponse();
    m_isNull = false;
    
    m_mimeType = mimeType; 
}
void ResourceResponse::setExpectedContentLength(long long expectedContentLength)
{
    updateResourceResponse();
    m_isNull = false;
    
    m_expectedContentLength = expectedContentLength; 
}
void InspectorController::willSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    if (!enabled())
        return;

    InspectorResource* resource = m_resources.get(identifier).get();
    if (!resource)
        return;

    resource->startTime = currentTime();

    if (!redirectResponse.isNull()) {
        updateResourceRequest(resource, request);
        updateResourceResponse(resource, redirectResponse);
    }

    if (resource != m_mainResource && windowVisible()) {
        if (!resource->scriptObject)
            addScriptResource(resource);
        else
            updateScriptResourceRequest(resource);

        updateScriptResource(resource, resource->startTime, resource->responseReceivedTime, resource->endTime);

        if (!redirectResponse.isNull())
            updateScriptResourceResponse(resource);
    }
}
bool ResourceResponse::isHTTP() const
{
    updateResourceResponse();
    
    String protocol = m_url.protocol();
    
    return equalIgnoringCase(protocol, "http")  || equalIgnoringCase(protocol, "https");
}
bool ResourceResponse::isAttachment() const
{
    updateResourceResponse();

    String value = m_httpHeaderFields.get("Content-Disposition");
    int loc = value.find(';');
    if (loc != -1)
        value = value.left(loc);
    value = value.stripWhiteSpace();
    return equalIgnoringCase(value, "attachment");
}
void InspectorController::didReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse& response)
{
    if (!enabled())
        return;

    InspectorResource* resource = m_resources.get(identifier).get();
    if (!resource)
        return;

    updateResourceResponse(resource, response);

    resource->responseReceivedTime = currentTime();

    if (windowVisible() && resource->scriptObject) {
        updateScriptResourceResponse(resource);
        updateScriptResource(resource, resource->startTime, resource->responseReceivedTime, resource->endTime);
    }
}
Beispiel #11
0
const String& ResourceResponse::mimeType() const
{
    updateResourceResponse();

    return m_mimeType; 
}
void ResourceResponse::setTextEncoding( String& textEncoding)
{
    updateResourceResponse();
    m_textEncodingName = textEncoding;
}
Beispiel #13
0
const KURL& ResourceResponse::url() const
{
    updateResourceResponse();
    
    return m_url; 
}
Beispiel #14
0
// FIXME should compute this on the fly
const String& ResourceResponse::suggestedFilename() const
{
    updateResourceResponse();

    return m_suggestedFilename;
}
Beispiel #15
0
void ResourceResponse::setHTTPStatusText(const String& statusText) 
{
    updateResourceResponse();

    m_httpStatusText = statusText; 
}
Beispiel #16
0
int ResourceResponse::httpStatusCode() const
{
    updateResourceResponse();

    return m_httpStatusCode; 
}
Beispiel #17
0
time_t ResourceResponse::expirationDate() const
{
    updateResourceResponse();

    return m_expirationDate; 
}
Beispiel #18
0
const String& ResourceResponse::textEncodingName() const
{
    updateResourceResponse();

    return m_textEncodingName;
}
void ResourceResponse::setURL( const KURL& url)
{
    updateResourceResponse();
    m_url = url;
}
Beispiel #20
0
void ResourceResponse::setExpirationDate(time_t expirationDate)
{
    updateResourceResponse();

    m_expirationDate = expirationDate;
}
Beispiel #21
0
void ResourceResponse::setHTTPStatusCode(int statusCode)
{
    updateResourceResponse();

    m_httpStatusCode = statusCode;
}
Beispiel #22
0
void ResourceResponse::setHTTPHeaderField(const String& name, const String& value)
{
    updateResourceResponse();

    m_httpHeaderFields.set(name, value);
}
Beispiel #23
0
String ResourceResponse::httpHeaderField(const String& name) const
{
    updateResourceResponse();

    return m_httpHeaderFields.get(name); 
}
Beispiel #24
0
long long ResourceResponse::expectedContentLength() const 
{
    updateResourceResponse();

    return m_expectedContentLength;
}
Beispiel #25
0
void ResourceResponse::setLastModifiedDate(time_t lastModifiedDate) 
{
    updateResourceResponse();

    m_lastModifiedDate = lastModifiedDate; 
}
void ResourceResponse::setMimeType( String& mimeType)
{
    updateResourceResponse();
    m_mimeType = mimeType;
}
Beispiel #27
0
time_t ResourceResponse::lastModifiedDate() const
{
    updateResourceResponse();

    return m_lastModifiedDate; 
}
Beispiel #28
0
const HTTPHeaderMap& ResourceResponse::httpHeaderFields() const
{
    updateResourceResponse();

    return m_httpHeaderFields; 
}
Beispiel #29
0
const String& ResourceResponse::httpStatusText() const 
{
    updateResourceResponse();

    return m_httpStatusText; 
}