webengine/osswebengine/WebCore/loader/CachedResource.cpp
changeset 5 10e98eab6f85
parent 0 dd21522fd290
equal deleted inserted replaced
1:7c90e6132015 5:10e98eab6f85
    33 #include "SystemTime.h"
    33 #include "SystemTime.h"
    34 #include <wtf/Vector.h>
    34 #include <wtf/Vector.h>
    35 
    35 
    36 namespace WebCore {
    36 namespace WebCore {
    37 
    37 
    38 CachedResource::CachedResource(const String& URL, Type type, bool forCache, bool sendResourceLoadCallbacks)
    38 CachedResource::CachedResource(const String& URL, Type type)
    39     : m_lastDecodedAccessTime(0)
    39     : m_lastDecodedAccessTime(0)
    40     , m_sendResourceLoadCallbacks(sendResourceLoadCallbacks)
    40     , m_sendResourceLoadCallbacks(true)
    41 #if PRELOAD_SCANNER_ENABLED
    41 #if PRELOAD_SCANNER_ENABLED
    42     , m_preloadCount(0)
    42     , m_preloadCount(0)
    43     , m_preloadResult(PreloadNotReferenced)
    43     , m_preloadResult(PreloadNotReferenced)
    44     , m_requestedFromNetworkingLayer(false)
    44     , m_requestedFromNetworkingLayer(false)
    45 #endif
    45 #endif
    46     , m_inCache(forCache)
    46     , m_inCache(false)
       
    47 	, m_loading(false)
    47     , m_docLoader(0)
    48     , m_docLoader(0)
    48 {
    49 {
    49     m_url = URL;
    50     m_url = URL;
    50     m_type = type;
    51     m_type = type;
    51     m_status = Pending;
    52     m_status = Pending;
    72 
    73 
    73 CachedResource::~CachedResource()
    74 CachedResource::~CachedResource()
    74 {
    75 {
    75     ASSERT(!inCache());
    76     ASSERT(!inCache());
    76     ASSERT(!m_deleted);
    77     ASSERT(!m_deleted);
       
    78 	ASSERT(cache()->resourceForURL(url()) != this);
    77 #ifndef NDEBUG
    79 #ifndef NDEBUG
    78     m_deleted = true;
    80     m_deleted = true;
    79 #endif
    81 #endif
    80     
    82     
    81     if (m_docLoader)
    83     if (m_docLoader)
    82         m_docLoader->removeCachedResource(this);
    84         m_docLoader->removeCachedResource(this);
    83 }
    85 }
       
    86 
       
    87 void CachedResource::load(DocLoader* docLoader, bool incremental, bool skipCanLoadCheck, bool sendResourceLoadCallbacks) 
       
    88 { 
       
    89     m_sendResourceLoadCallbacks = sendResourceLoadCallbacks; 
       
    90     cache()->loader()->load(docLoader, this, incremental, skipCanLoadCheck, sendResourceLoadCallbacks); 
       
    91     m_loading = true; 
       
    92 } 
    84 
    93 
    85 void CachedResource::finish()
    94 void CachedResource::finish()
    86 {
    95 {
    87     m_status = Cached;
    96     m_status = Cached;
    88 }
    97 }