summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/appcache/ApplicationCacheHost.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/loader/appcache/ApplicationCacheHost.h')
-rw-r--r--WebCore/loader/appcache/ApplicationCacheHost.h59
1 files changed, 53 insertions, 6 deletions
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h
index 52d4d40..c224172 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.h
+++ b/WebCore/loader/appcache/ApplicationCacheHost.h
@@ -33,6 +33,7 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+#include "KURL.h"
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -40,10 +41,8 @@
#include <wtf/Vector.h>
namespace WebCore {
-
class DOMApplicationCache;
class DocumentLoader;
- class KURL;
class ResourceLoader;
class ResourceError;
class ResourceRequest;
@@ -81,6 +80,40 @@ namespace WebCore {
OBSOLETE_EVENT // Must remain the last value, this is used to size arrays.
};
+#if ENABLE(INSPECTOR)
+ struct CacheInfo {
+ CacheInfo(const KURL& manifest, double creationTime, double updateTime, long long size)
+ : m_manifest(manifest)
+ , m_creationTime(creationTime)
+ , m_updateTime(updateTime)
+ , m_size(size) { }
+ KURL m_manifest;
+ double m_creationTime;
+ double m_updateTime;
+ long long m_size;
+ };
+
+ struct ResourceInfo {
+ ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size)
+ : m_resource(resource)
+ , m_isMaster(isMaster)
+ , m_isManifest(isManifest)
+ , m_isFallback(isFallback)
+ , m_isForeign(isForeign)
+ , m_isExplicit(isExplicit)
+ , m_size(size) { }
+ KURL m_resource;
+ bool m_isMaster;
+ bool m_isManifest;
+ bool m_isFallback;
+ bool m_isForeign;
+ bool m_isExplicit;
+ long long m_size;
+ };
+
+ typedef Vector<ResourceInfo> ResourceInfoList;
+#endif
+
ApplicationCacheHost(DocumentLoader*);
~ApplicationCacheHost();
@@ -108,19 +141,33 @@ namespace WebCore {
bool update();
bool swapCache();
- void setDOMApplicationCache(DOMApplicationCache* domApplicationCache);
- void notifyDOMApplicationCache(EventID id);
+ void setDOMApplicationCache(DOMApplicationCache*);
+ void notifyDOMApplicationCache(EventID, int progressTotal, int progressDone);
void stopDeferringEvents(); // Also raises the events that have been queued up.
+#if ENABLE(INSPECTOR)
+ void fillResourceList(ResourceInfoList*);
+ CacheInfo applicationCacheInfo();
+#endif
+
private:
bool isApplicationCacheEnabled();
- DocumentLoader* documentLoader() { return m_documentLoader; }
+ DocumentLoader* documentLoader() const { return m_documentLoader; }
+
+ struct DeferredEvent {
+ EventID eventID;
+ int progressTotal;
+ int progressDone;
+ DeferredEvent(EventID id, int total, int done) : eventID(id), progressTotal(total), progressDone(done) { }
+ };
DOMApplicationCache* m_domApplicationCache;
DocumentLoader* m_documentLoader;
bool m_defersEvents; // Events are deferred until after document onload.
- Vector<EventID> m_deferredEvents;
+ Vector<DeferredEvent> m_deferredEvents;
+
+ void dispatchDOMEvent(EventID, int progressTotal, int progressDone);
#if PLATFORM(CHROMIUM)
friend class ApplicationCacheHostInternal;