Changeset 79110 in webkit


Ignore:
Timestamp:
Feb 19, 2011 12:39:38 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-19 Bill Budge <bbudge@chromium.org>

Reviewed by David Levin.

ThreadableLoaderClient needs willSendRequest method
https://bugs.webkit.org/show_bug.cgi?id=54688

No new tests. Exposes no new functionality

  • WebCore.gypi:
  • loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::willSendRequest): (WebCore::DocumentThreadableLoader::didReceiveData): (WebCore::DocumentThreadableLoader::didReceiveCachedMetadata):
  • loader/DocumentThreadableLoaderClient.h: Added. (WebCore::DocumentThreadableLoaderClient::isDocumentThreadableLoaderClient): (WebCore::DocumentThreadableLoaderClient::willSendRequest):
  • loader/ThreadableLoaderClient.h: (WebCore::ThreadableLoaderClient::isDocumentThreadableLoaderClient):
Location:
trunk/Source/WebCore
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79107 r79110  
     12011-02-19  Bill Budge  <bbudge@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        ThreadableLoaderClient needs willSendRequest method
     6        https://bugs.webkit.org/show_bug.cgi?id=54688
     7
     8        No new tests. Exposes no new functionality
     9
     10        * WebCore.gypi:
     11        * loader/DocumentThreadableLoader.cpp:
     12        (WebCore::DocumentThreadableLoader::willSendRequest):
     13        (WebCore::DocumentThreadableLoader::didReceiveData):
     14        (WebCore::DocumentThreadableLoader::didReceiveCachedMetadata):
     15        * loader/DocumentThreadableLoaderClient.h: Added.
     16        (WebCore::DocumentThreadableLoaderClient::isDocumentThreadableLoaderClient):
     17        (WebCore::DocumentThreadableLoaderClient::willSendRequest):
     18        * loader/ThreadableLoaderClient.h:
     19        (WebCore::ThreadableLoaderClient::isDocumentThreadableLoaderClient):
     20
    1212011-02-19  Charlie Reis  <creis@chromium.org>
    222
  • trunk/Source/WebCore/WebCore.gypi

    r79043 r79110  
    21612161            'loader/DocumentThreadableLoader.cpp',
    21622162            'loader/DocumentThreadableLoader.h',
     2163            'loader/DocumentThreadableLoaderClient.h',
    21632164            'loader/DocumentWriter.cpp',
    21642165            'loader/DocumentWriter.h',
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r78782 r79110  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636#include "CrossOriginPreflightResultCache.h"
    3737#include "Document.h"
     38#include "DocumentThreadableLoaderClient.h"
    3839#include "Frame.h"
    3940#include "FrameLoader.h"
     
    173174}
    174175
    175 void DocumentThreadableLoader::willSendRequest(SubresourceLoader* loader, ResourceRequest& request, const ResourceResponse&)
     176void DocumentThreadableLoader::willSendRequest(SubresourceLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
    176177{
    177178    ASSERT(m_client);
     
    182183        m_client->didFailRedirectCheck();
    183184        request = ResourceRequest();
     185    } else {
     186        if (m_client->isDocumentThreadableLoaderClient())
     187            static_cast<DocumentThreadableLoaderClient*>(m_client)->willSendRequest(request, redirectResponse);
    184188    }
    185189}
     
    231235    ASSERT_UNUSED(loader, loader == m_loader);
    232236
    233     // Ignore response body of preflight requests.
     237    // Preflight data should be invisible to clients.
    234238    if (m_actualRequest)
    235239        return;
     
    243247    ASSERT_UNUSED(loader, loader == m_loader);
    244248
    245     // Ignore response body of preflight requests.
    246     if (!m_actualRequest)
    247         m_client->didReceiveCachedMetadata(data, lengthReceived);
     249    // Preflight data should be invisible to clients.
     250    if (m_actualRequest)
     251        return;
     252
     253    m_client->didReceiveCachedMetadata(data, lengthReceived);
    248254}
    249255
  • trunk/Source/WebCore/loader/DocumentThreadableLoaderClient.h

    r79108 r79110  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef ThreadableLoaderClient_h
    32 #define ThreadableLoaderClient_h
     31#ifndef DocumentThreadableLoaderClient_h
     32#define DocumentThreadableLoaderClient_h
    3333
     34#include "ThreadableLoaderClient.h"
    3435
    3536namespace WebCore {
    3637
    37     class ResourceError;
    38     class ResourceResponse;
     38class ResourceRequest;
     39class ResourceResponse;
    3940
    40     class ThreadableLoaderClient {
    41         WTF_MAKE_NONCOPYABLE(ThreadableLoaderClient); WTF_MAKE_FAST_ALLOCATED;
    42     public:
    43         virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/) { }
     41class DocumentThreadableLoaderClient : public ThreadableLoaderClient {
     42    WTF_MAKE_NONCOPYABLE(DocumentThreadableLoaderClient);
     43    WTF_MAKE_FAST_ALLOCATED;
     44public:
     45    virtual bool isDocumentThreadableLoaderClient() { return true; }
    4446
    45         virtual void didReceiveResponse(const ResourceResponse&) { }
    46         virtual void didReceiveData(const char*, int /*dataLength*/) { }
    47         virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/) { }
    48         virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/) { }
    49         virtual void didFail(const ResourceError&) { }
    50         virtual void didFailRedirectCheck() { }
    51 
    52         virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { }
    53 
    54     protected:
    55         ThreadableLoaderClient() { }
    56         virtual ~ThreadableLoaderClient() { }
    57     };
     47    virtual void willSendRequest(ResourceRequest& /*newRequest*/, const ResourceResponse& /*redirectResponse*/) { }
     48};
    5849
    5950} // namespace WebCore
    6051
    61 #endif // ThreadableLoaderClient_h
     52#endif // DocumentThreadableLoaderClient_h
  • trunk/Source/WebCore/loader/ThreadableLoaderClient.h

    r78782 r79110  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5252        virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { }
    5353
     54        virtual bool isDocumentThreadableLoaderClient() { return false; }
     55
    5456    protected:
    5557        ThreadableLoaderClient() { }
Note: See TracChangeset for help on using the changeset viewer.