Changeset 31916 in webkit


Ignore:
Timestamp:
Apr 15, 2008 12:44:40 PM (16 years ago)
Author:
andersca@apple.com
Message:

2008-04-15 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Move the URL, response and data to SubstituteResource.


  • loader/SubstituteResource.h: (WebCore::SubstituteResource::url): (WebCore::SubstituteResource::response): (WebCore::SubstituteResource::data): (WebCore::SubstituteResource::SubstituteResource):
  • loader/archive/ArchiveResource.cpp: (WebCore::ArchiveResource::ArchiveResource):
  • loader/archive/ArchiveResource.h: (WebCore::ArchiveResource::frameName):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31915 r31916  
     12008-04-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Adam.
     4
     5        Move the URL, response and data to SubstituteResource.
     6       
     7        * loader/SubstituteResource.h:
     8        (WebCore::SubstituteResource::url):
     9        (WebCore::SubstituteResource::response):
     10        (WebCore::SubstituteResource::data):
     11        (WebCore::SubstituteResource::SubstituteResource):
     12        * loader/archive/ArchiveResource.cpp:
     13        (WebCore::ArchiveResource::ArchiveResource):
     14        * loader/archive/ArchiveResource.h:
     15        (WebCore::ArchiveResource::frameName):
     16
    1172008-04-15  David Hyatt  <hyatt@apple.com>
    218
  • trunk/WebCore/loader/SubstituteResource.h

    r31914 r31916  
    2929#include <wtf/RefCounted.h>
    3030
     31#include "KURL.h"
     32#include "ResourceResponse.h"
     33#include "SharedBuffer.h"
     34
     35#include <wtf/RefPtr.h>
     36
    3137namespace WebCore {
    3238
    3339class SubstituteResource : public RefCounted<SubstituteResource> {
     40public:
     41    const KURL& url() const { return m_url; }
     42    const ResourceResponse& response() const { return m_response; }
     43    SharedBuffer* data() const { return m_data.get(); }
     44
     45protected:
     46    SubstituteResource(const KURL& url, const ResourceResponse& response, PassRefPtr<SharedBuffer> data)
     47        : m_url(url)
     48        , m_response(response)
     49        , m_data(data)
     50    {
     51    }
     52   
     53private:
     54    KURL m_url;
     55    ResourceResponse m_response;
     56    RefPtr<SharedBuffer> m_data;
    3457};
    3558   
  • trunk/WebCore/loader/archive/ArchiveResource.cpp

    r31826 r31916  
    5050
    5151ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response)
    52     : m_data(data)
    53     , m_url(url)
     52    : SubstituteResource(url, response, data)
    5453    , m_mimeType(response.mimeType())
    5554    , m_textEncoding(response.textEncodingName())
    56     , m_response(response)
    5755    , m_shouldIgnoreWhenUnarchiving(false)
    5856{
     
    6058
    6159ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName)
    62     : m_data(data)
    63     , m_url(url)
     60    : SubstituteResource(url, ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()), data)
    6461    , m_mimeType(mimeType)
    6562    , m_textEncoding(textEncoding)
    6663    , m_frameName(frameName)
    67     , m_response(ResourceResponse(m_url, m_mimeType, m_data ? m_data->size() : 0, m_textEncoding, String()))
    6864    , m_shouldIgnoreWhenUnarchiving(false)
    6965{
     
    7167
    7268ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
    73     : m_data(data)
    74     , m_url(url)
     69    : SubstituteResource(url, response.isNull() ? ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()) : response, data)
    7570    , m_mimeType(mimeType)
    7671    , m_textEncoding(textEncoding)
    7772    , m_frameName(frameName)
    78     , m_response(response.isNull() ? ResourceResponse(m_url, m_mimeType, m_data ? m_data->size() : 0, m_textEncoding, String()) : response)
    7973    , m_shouldIgnoreWhenUnarchiving(false)
    8074{
  • trunk/WebCore/loader/archive/ArchiveResource.h

    r31914 r31916  
    3232#include "SubstituteResource.h"
    3333
    34 #include "KURL.h"
    3534#include "PlatformString.h"
    36 #include "ResourceResponse.h"
    37 #include "SharedBuffer.h"
    3835
    3936namespace WebCore {
     
    4542    static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
    4643   
    47     SharedBuffer* data() { return m_data.get(); }
    48    
    49     const KURL& url() const { return m_url; }
    5044    const String& mimeType() const { return m_mimeType; }
    5145    const String& textEncoding() const { return m_textEncoding; }
    5246    const String& frameName() const { return m_frameName; }
    53     const ResourceResponse& response() const { return m_response; }
    5447   
    5548    void ignoreWhenUnarchiving() { m_shouldIgnoreWhenUnarchiving = true; }
     
    6154    ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
    6255   
    63     RefPtr<SharedBuffer> m_data;
    64     KURL m_url;
    6556    String m_mimeType;
    6657    String m_textEncoding;
    6758    String m_frameName;
    68    
    69     ResourceResponse m_response;
    7059   
    7160    bool m_shouldIgnoreWhenUnarchiving;
Note: See TracChangeset for help on using the changeset viewer.