summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/web_application_cache_host_impl.h
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 21:46:31 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 21:46:31 +0000
commitf430b57130adff68db69f340c68b6afe5746edc5 (patch)
tree3c1e56173a34f7ea652ebe6c450c22ba9ddce0ae /webkit/appcache/web_application_cache_host_impl.h
parent8177d9bbcda50fdba18f19f131024a4704c376f8 (diff)
downloadchromium_src-f430b57130adff68db69f340c68b6afe5746edc5.zip
chromium_src-f430b57130adff68db69f340c68b6afe5746edc5.tar.gz
chromium_src-f430b57130adff68db69f340c68b6afe5746edc5.tar.bz2
Retrofit the pre-existing appache message dispatching with the new WebKit APIs and concrete classes defined in our new appcache library, and get rid of the old files.
There are many files in the CL, mostly to pickup constant values now defined in our new appcache library, and to reflect a terminilogy change (from 'context' to 'host'). TEST=some existing unit tests apply BUG=none Review URL: http://codereview.chromium.org/170003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/web_application_cache_host_impl.h')
-rw-r--r--webkit/appcache/web_application_cache_host_impl.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/webkit/appcache/web_application_cache_host_impl.h b/webkit/appcache/web_application_cache_host_impl.h
new file mode 100644
index 0000000..dbc00f1
--- /dev/null
+++ b/webkit/appcache/web_application_cache_host_impl.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_APPCACHE_WEB_APPLICATION_CACHE_HOST_IMPL_H_
+#define WEBKIT_APPCACHE_WEB_APPLICATION_CACHE_HOST_IMPL_H_
+
+#include "googleurl/src/gurl.h"
+#include "webkit/api/public/WebApplicationCacheHostClient.h"
+#include "webkit/api/public/WebURLResponse.h"
+#include "webkit/appcache/appcache_interfaces.h"
+
+namespace appcache {
+
+class WebApplicationCacheHostImpl : public WebKit::WebApplicationCacheHost {
+ public:
+ // Returns the host having given id or NULL if there is no such host.
+ static WebApplicationCacheHostImpl* FromId(int id);
+
+ WebApplicationCacheHostImpl(WebKit::WebApplicationCacheHostClient* client,
+ AppCacheBackend* backend);
+ virtual ~WebApplicationCacheHostImpl();
+
+ int host_id() const { return host_id_; }
+
+ void OnCacheSelected(int64 selected_cache_id, appcache::Status status);
+ void OnStatusChanged(appcache::Status);
+ void OnEventRaised(appcache::EventID);
+
+ // WebApplicationCacheHost methods
+ virtual void willStartMainResourceRequest(WebKit::WebURLRequest&);
+ virtual void willStartSubResourceRequest(WebKit::WebURLRequest&);
+ virtual void selectCacheWithoutManifest();
+ virtual bool selectCacheWithManifest(const WebKit::WebURL& manifestURL);
+ virtual void didReceiveResponseForMainResource(const WebKit::WebURLResponse&);
+ virtual void didReceiveDataForMainResource(const char* data, int len);
+ virtual void didFinishLoadingMainResource(bool success);
+ virtual WebKit::WebApplicationCacheHost::Status status();
+ virtual bool startUpdate();
+ virtual bool swapCache();
+
+ private:
+ enum ShouldCaptureMainResponse {
+ MAYBE,
+ YES,
+ NO
+ };
+
+ WebKit::WebApplicationCacheHostClient* client_;
+ AppCacheBackend* backend_;
+ int host_id_;
+ bool has_status_;
+ appcache::Status status_;
+ bool has_cached_status_;
+ appcache::Status cached_status_;
+ WebKit::WebURLResponse main_response_;
+ GURL main_response_url_;
+ bool is_in_http_family_;
+ ShouldCaptureMainResponse should_capture_main_response_;
+};
+
+} // namespace
+
+#endif // WEBKIT_APPCACHE_WEB_APPLICATION_CACHE_HOST_IMPL_H_