equal
deleted
inserted
replaced
32 |
32 |
33 namespace WebCore { |
33 namespace WebCore { |
34 |
34 |
35 class Cache; |
35 class Cache; |
36 class CachedResourceClient; |
36 class CachedResourceClient; |
|
37 class CacheHandleBase; |
37 class DocLoader; |
38 class DocLoader; |
38 class Request; |
39 class Request; |
39 |
40 |
40 // A resource that is held in the cache. Classes who want to use this object should derive |
41 // A resource that is held in the cache. Classes who want to use this object should derive |
41 // from CachedResourceClient, to get the function calls in case the requested data has arrived. |
42 // from CachedResourceClient, to get the function calls in case the requested data has arrived. |
62 New, // inserting new item |
63 New, // inserting new item |
63 Pending, // only partially loaded |
64 Pending, // only partially loaded |
64 Cached // regular case |
65 Cached // regular case |
65 }; |
66 }; |
66 |
67 |
67 CachedResource(const String& URL, Type, bool forCache = true, bool sendResourceLoadCallbacks = false); |
68 CachedResource(const String& URL, Type); |
68 virtual ~CachedResource(); |
69 virtual ~CachedResource(); |
|
70 virtual void load(DocLoader* docLoader) { load(docLoader, false, false, true); } |
|
71 void load(DocLoader*, bool incremental, bool skipCanLoadCheck, bool sendResourceLoadCallbacks); |
69 |
72 |
70 virtual void setEncoding(const String&) { } |
73 virtual void setEncoding(const String&) { } |
71 virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived) = 0; |
74 virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived) = 0; |
72 virtual void error() = 0; |
75 virtual void error() = 0; |
73 |
76 |
85 PreloadReferencedWhileComplete |
88 PreloadReferencedWhileComplete |
86 }; |
89 }; |
87 PreloadResult preloadResult() const { return m_preloadResult; } |
90 PreloadResult preloadResult() const { return m_preloadResult; } |
88 void setRequestedFromNetworkingLayer() { m_requestedFromNetworkingLayer = true; } |
91 void setRequestedFromNetworkingLayer() { m_requestedFromNetworkingLayer = true; } |
89 #endif |
92 #endif |
90 virtual void allReferencesRemoved() {}; |
93 virtual void allReferencesRemoved() {} |
91 |
94 |
92 unsigned count() const { return m_clients.size(); } |
95 unsigned count() const { return m_clients.size(); } |
93 |
96 |
94 Status status() const { return m_status; } |
97 Status status() const { return m_status; } |
95 |
98 |
142 |
145 |
143 bool errorOccurred() const { return m_errorOccurred; } |
146 bool errorOccurred() const { return m_errorOccurred; } |
144 bool treatAsLocal() const { return m_shouldTreatAsLocal; } |
147 bool treatAsLocal() const { return m_shouldTreatAsLocal; } |
145 bool sendResourceLoadCallbacks() const { return m_sendResourceLoadCallbacks; } |
148 bool sendResourceLoadCallbacks() const { return m_sendResourceLoadCallbacks; } |
146 |
149 |
147 virtual void destroyDecodedData() {}; |
150 virtual void destroyDecodedData() {} |
148 |
151 |
149 void setDocLoader(DocLoader* docLoader) { m_docLoader = docLoader; } |
152 void setDocLoader(DocLoader* docLoader) { m_docLoader = docLoader; } |
150 #if PRELOAD_SCANNER_ENABLED |
153 #if PRELOAD_SCANNER_ENABLED |
151 bool isPreloaded() const { return m_preloadCount; } |
154 bool isPreloaded() const { return m_preloadCount; } |
152 void increasePreloadCount() { ++m_preloadCount; } |
155 void increasePreloadCount() { ++m_preloadCount; } |