diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h b/chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h index 140558900e3..47ebab0182e 100644 --- a/chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h +++ b/chromium/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.h @@ -32,6 +32,7 @@ #define ApplicationCacheHost_h #include "platform/weborigin/KURL.h" +#include "public/platform/WebApplicationCacheHostClient.h" #include "wtf/Deque.h" #include "wtf/OwnPtr.h" #include "wtf/PassRefPtr.h" @@ -41,16 +42,15 @@ namespace WebCore { class ApplicationCache; class DocumentLoader; - class Frame; + class LocalFrame; class ResourceLoader; class ResourceError; class ResourceRequest; class ResourceResponse; class SubstituteData; - class ApplicationCacheHostInternal; - class ApplicationCacheHost { - WTF_MAKE_NONCOPYABLE(ApplicationCacheHost); WTF_MAKE_FAST_ALLOCATED; + class ApplicationCacheHost : public blink::WebApplicationCacheHostClient { + WTF_MAKE_NONCOPYABLE(ApplicationCacheHost); public: // The Status numeric values are specified in the HTML5 spec. enum Status { @@ -105,8 +105,8 @@ namespace WebCore { typedef Vector<ResourceInfo> ResourceInfoList; - ApplicationCacheHost(DocumentLoader*); - ~ApplicationCacheHost(); + explicit ApplicationCacheHost(DocumentLoader*); + virtual ~ApplicationCacheHost(); void selectCacheWithoutManifest(); void selectCacheWithManifest(const KURL& manifestURL); @@ -125,7 +125,7 @@ namespace WebCore { void abort(); void setApplicationCache(ApplicationCache*); - void notifyApplicationCache(EventID, int progressTotal, int progressDone); + void notifyApplicationCache(EventID, int progressTotal, int progressDone, blink::WebApplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage); void stopDeferringEvents(); // Also raises the events that have been queued up. @@ -133,6 +133,12 @@ namespace WebCore { CacheInfo applicationCacheInfo(); private: + // WebApplicationCacheHostClient implementation + virtual void didChangeCacheAssociation() OVERRIDE FINAL; + virtual void notifyEventListener(blink::WebApplicationCacheHost::EventID) OVERRIDE FINAL; + virtual void notifyProgressEventListener(const blink::WebURL&, int progressTotal, int progressDone) OVERRIDE FINAL; + virtual void notifyErrorEventListener(blink::WebApplicationCacheHost::ErrorReason, const blink::WebURL&, int status, const blink::WebString& message) OVERRIDE FINAL; + bool isApplicationCacheEnabled(); DocumentLoader* documentLoader() const { return m_documentLoader; } @@ -140,7 +146,20 @@ namespace WebCore { EventID eventID; int progressTotal; int progressDone; - DeferredEvent(EventID id, int total, int done) : eventID(id), progressTotal(total), progressDone(done) { } + blink::WebApplicationCacheHost::ErrorReason errorReason; + String errorURL; + int errorStatus; + String errorMessage; + DeferredEvent(EventID id, int progressTotal, int progressDone, blink::WebApplicationCacheHost::ErrorReason errorReason, const String& errorURL, int errorStatus, const String& errorMessage) + : eventID(id) + , progressTotal(progressTotal) + , progressDone(progressDone) + , errorReason(errorReason) + , errorURL(errorURL) + , errorStatus(errorStatus) + , errorMessage(errorMessage) + { + } }; ApplicationCache* m_domApplicationCache; @@ -148,10 +167,9 @@ namespace WebCore { bool m_defersEvents; // Events are deferred until after document onload. Vector<DeferredEvent> m_deferredEvents; - void dispatchDOMEvent(EventID, int progressTotal, int progressDone); + void dispatchDOMEvent(EventID, int progressTotal, int progressDone, blink::WebApplicationCacheHost::ErrorReason, const String& errorURL, int errorStatus, const String& errorMessage); - friend class ApplicationCacheHostInternal; - OwnPtr<ApplicationCacheHostInternal> m_internal; + OwnPtr<blink::WebApplicationCacheHost> m_host; }; } // namespace WebCore |