summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 20:41:51 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-12 20:41:51 +0000
commita4662a6c19bae19547199eba15d6bbf2f538e912 (patch)
treee7d7fddb58f67b67d55b3732ed7a4df38f0a22b1
parent44838a83ab6f2dec072a044316142ffd819f3e49 (diff)
downloadchromium_src-a4662a6c19bae19547199eba15d6bbf2f538e912.zip
chromium_src-a4662a6c19bae19547199eba15d6bbf2f538e912.tar.gz
chromium_src-a4662a6c19bae19547199eba15d6bbf2f538e912.tar.bz2
Appcache related WebKit API additions. With this patch the compile-time flag is enabled, but the run-time flag is disabled.
1) Added a new class WebApplicationCacheHost and a factory method on WebKitClient. 2) Provide an implementation of WebCore's ApplicationCachHost class that calls out to chrome thru the new WebKit API. 3) Added new files to gyp and turned on the compile-time ENABLE(OFFLINE_WEB_APPLICATIONS) flag. 4) Turned on the compile-time flag for v8 bindings in build-generated-files.sh 4) Disabled the run-time appliation_cache_enabled settings in the test shell for now. BUG=none TEST=none Review URL: http://codereview.chromium.org/165222 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23217 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/api/public/WebApplicationCacheHost.h94
-rw-r--r--webkit/api/public/WebApplicationCacheHostClient.h53
-rw-r--r--webkit/api/public/WebKitClient.h8
-rw-r--r--webkit/api/src/ApplicationCacheHost.cpp260
-rw-r--r--webkit/api/src/WebSettingsImpl.cpp4
-rwxr-xr-xwebkit/build/V8Bindings/build-generated-files.sh2
-rw-r--r--webkit/glue/chrome_client_impl.h5
-rw-r--r--webkit/glue/webkitclient_impl.cc7
-rw-r--r--webkit/glue/webkitclient_impl.h3
-rw-r--r--webkit/tools/test_shell/test_shell.cc2
-rw-r--r--webkit/webkit.gyp11
11 files changed, 441 insertions, 8 deletions
diff --git a/webkit/api/public/WebApplicationCacheHost.h b/webkit/api/public/WebApplicationCacheHost.h
new file mode 100644
index 0000000..e7cffa9
--- /dev/null
+++ b/webkit/api/public/WebApplicationCacheHost.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebApplicationCacheHost_h
+#define WebApplicationCacheHost_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+ class WebApplicationCacheHostClient;
+ class WebURL;
+ class WebURLRequest;
+ class WebURLResponse;
+ struct WebURLError;
+
+ // This interface is used by webkit to call out to the embedder. Webkit uses
+ // the WebKitClient::createApplicationCacheHost method to create instances,
+ // and calls delete when the instance is no longer needed.
+ class WebApplicationCacheHost {
+ public:
+ // These values must match WebCore::ApplicationCacheHost::Status values
+ enum Status {
+ Uncached,
+ Idle,
+ Checking,
+ Downloading,
+ UpdateReady,
+ Obsolete
+ };
+
+ // These values must match WebCore::ApplicationCacheHost::EventID values
+ enum EventID {
+ CheckingEvent,
+ ErrorEvent,
+ NoUpdateEvent,
+ DownloadingEvent,
+ ProgressEvent,
+ UpdateReadyEvent,
+ CachedEvent,
+ ObsoleteEvent
+ };
+
+ virtual ~WebApplicationCacheHost() { }
+
+ // Called for every request made within the context.
+ virtual void willStartMainResourceRequest(WebURLRequest&) = 0;
+ virtual void willStartSubResourceRequest(WebURLRequest&) = 0;
+
+ // One or the other is called after having parsed the <html> tag.
+ virtual void selectCacheWithoutManifest() = 0;
+ virtual void selectCacheWithManifest(const WebURL& manifestURL) = 0;
+
+ // Called as the main resource is retrieved.
+ virtual void didReceiveResponseForMainResource(const WebURLResponse&) = 0;
+ virtual void didReceiveDataForMainResource(const char* data, int len) = 0;
+ virtual void didFinishLoadingMainResource(bool success) = 0;
+
+ // Called on behalf of the scriptable interface.
+ virtual Status status() = 0;
+ virtual bool startUpdate() = 0;
+ virtual bool swapCache() = 0;
+ };
+
+} // namespace WebKit
+
+#endif // WebApplicationCacheHost_h
+
diff --git a/webkit/api/public/WebApplicationCacheHostClient.h b/webkit/api/public/WebApplicationCacheHostClient.h
new file mode 100644
index 0000000..2a7fa58
--- /dev/null
+++ b/webkit/api/public/WebApplicationCacheHostClient.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebApplicationCacheHostClient_h
+#define WebApplicationCacheHostClient_h
+
+#include "WebCommon.h"
+#include "WebApplicationCacheHost.h"
+
+namespace WebKit {
+
+ // This interface is used by the embedder to call into webkit.
+ class WebApplicationCacheHostClient {
+ public:
+ // Called to fire the event in the scriptable interface.
+ virtual void notifyEventListener(WebApplicationCacheHost::EventID) = 0;
+
+ protected:
+ // Should not be deleted by the embedder.
+ virtual ~WebApplicationCacheHostClient() { }
+ };
+
+} // namespace WebKit
+
+#endif // WebApplicationCacheHostClient_h
+
diff --git a/webkit/api/public/WebKitClient.h b/webkit/api/public/WebKitClient.h
index 0eaf4da..9ecf0c3 100644
--- a/webkit/api/public/WebKitClient.h
+++ b/webkit/api/public/WebKitClient.h
@@ -41,6 +41,8 @@
#endif
namespace WebKit {
+ class WebApplicationCacheHost;
+ class WebApplicationCacheHostClient;
class WebClipboard;
class WebData;
class WebMessagePortChannel;
@@ -70,6 +72,12 @@ namespace WebKit {
virtual WebThemeEngine* themeEngine() = 0;
+ // Application Cache --------------------------------------------
+
+ // May return null if the process type doesn't involve appcaching.
+ virtual WebApplicationCacheHost* createApplicationCacheHost(WebApplicationCacheHostClient*) = 0;
+
+
// DOM Storage --------------------------------------------------
// Return a LocalStorage namespace that corresponds to the following
diff --git a/webkit/api/src/ApplicationCacheHost.cpp b/webkit/api/src/ApplicationCacheHost.cpp
new file mode 100644
index 0000000..b8dc1ff
--- /dev/null
+++ b/webkit/api/src/ApplicationCacheHost.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ApplicationCacheHost.h"
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+
+#include "DocumentLoader.h"
+#include "DOMApplicationCache.h"
+#include "Frame.h"
+#include "Settings.h"
+#include "WebApplicationCacheHost.h"
+#include "WebApplicationCacheHostClient.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
+#include "WebURL.h"
+#include "WebURLError.h"
+#include "WebURLResponse.h"
+#include "WrappedResourceRequest.h"
+#include "WrappedResourceResponse.h"
+
+using namespace WebKit;
+
+namespace WebCore {
+
+// ApplicationCacheHostInternal -----------------------------------------------
+
+class ApplicationCacheHostInternal : public WebApplicationCacheHostClient {
+public:
+ ApplicationCacheHostInternal(ApplicationCacheHost* host)
+ : m_innerHost(host)
+ {
+ m_outerHost.set(WebKit::webKitClient()->createApplicationCacheHost(this));
+ }
+
+ virtual void notifyEventListener(WebApplicationCacheHost::EventID eventID)
+ {
+ m_innerHost->notifyEventListener(static_cast<ApplicationCacheHost::EventID>(eventID));
+ }
+
+ ApplicationCacheHost* m_innerHost;
+ OwnPtr<WebApplicationCacheHost> m_outerHost;
+};
+
+// ApplicationCacheHost -------------------------------------------------------
+// We provide a custom implementation of this class that calls out to the
+// embedding application instead of using WebCore's built in appcache system.
+// This file replaces webcore/appcache/ApplicationCacheHost.cpp in our build.
+
+ApplicationCacheHost::ApplicationCacheHost(DocumentLoader* documentLoader)
+ : m_domApplicationCache(0)
+ , m_documentLoader(documentLoader)
+{
+ ASSERT(m_documentLoader);
+}
+
+ApplicationCacheHost::~ApplicationCacheHost()
+{
+}
+
+void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, SubstituteData&)
+{
+ // We defer creating the outer host object to avoid spurious creation/destruction
+ // around creating empty documents. At this point, we're initiating a main resource
+ // load for the document, so its for real.
+
+ if (!isApplicationCacheEnabled())
+ return;
+
+ m_internal.set(new ApplicationCacheHostInternal(this));
+ if (m_internal->m_outerHost) {
+ WrappedResourceRequest wrapped(request);
+ m_internal->m_outerHost->willStartMainResourceRequest(wrapped);
+ } else
+ m_internal.clear();
+
+ // NOTE: The semantics of this method, and others in this interface, are subtly different
+ // than the method names would suggest. For example, in this method never returns an appcached
+ // response in the SubstituteData out argument, instead we return the appcached response thru
+ // the usual resource loading pipeline.
+}
+
+void ApplicationCacheHost::selectCacheWithoutManifest()
+{
+ if (m_internal)
+ m_internal->m_outerHost->selectCacheWithoutManifest();
+}
+
+void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL)
+{
+ if (m_internal)
+ m_internal->m_outerHost->selectCacheWithManifest(WebURL(manifestURL));
+}
+
+bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse& response)
+{
+ if (m_internal) {
+ WrappedResourceResponse wrapped(response);
+ m_internal->m_outerHost->didReceiveResponseForMainResource(wrapped);
+ }
+ return false;
+}
+
+bool ApplicationCacheHost::maybeLoadFallbackForMainError(const ResourceRequest&, const ResourceError& error)
+{
+ // N/A to the chromium port
+ return false;
+}
+
+void ApplicationCacheHost::mainResourceDataReceived(const char* data, int length, long long, bool)
+{
+ if (m_internal)
+ m_internal->m_outerHost->didReceiveDataForMainResource(data, length);
+}
+
+void ApplicationCacheHost::failedLoadingMainResource()
+{
+ if (m_internal)
+ m_internal->m_outerHost->didFinishLoadingMainResource(false);
+}
+
+void ApplicationCacheHost::finishedLoadingMainResource()
+{
+ if (m_internal)
+ m_internal->m_outerHost->didFinishLoadingMainResource(true);
+}
+
+bool ApplicationCacheHost::maybeLoadResource(ResourceLoader*, ResourceRequest& request, const KURL&)
+{
+ // FIXME: look into the purpose of the unused KURL& originalURL parameter
+ if (m_internal) {
+ WrappedResourceRequest wrapped(request);
+ m_internal->m_outerHost->willStartSubResourceRequest(wrapped);
+ }
+ return false;
+}
+
+bool ApplicationCacheHost::maybeLoadFallbackForRedirect(ResourceLoader*, ResourceRequest&, const ResourceResponse&)
+{
+ // N/A to the chromium port
+ return false;
+}
+
+bool ApplicationCacheHost::maybeLoadFallbackForResponse(ResourceLoader*, const ResourceResponse&)
+{
+ // N/A to the chromium port
+ return false;
+}
+
+bool ApplicationCacheHost::maybeLoadFallbackForError(ResourceLoader*, const ResourceError&)
+{
+ // N/A to the chromium port
+ return false;
+}
+
+bool ApplicationCacheHost::maybeLoadSynchronously(ResourceRequest& request, ResourceError&, ResourceResponse&, Vector<char>&)
+{
+ if (m_internal) {
+ WrappedResourceRequest wrapped(request);
+ m_internal->m_outerHost->willStartSubResourceRequest(wrapped);
+ }
+ return false;
+}
+
+void ApplicationCacheHost::maybeLoadFallbackSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>&)
+{
+ // N/A to the chromium port
+}
+
+bool ApplicationCacheHost::canCacheInPageCache() const
+{
+ // N/A to the chromium port which doesn't use the page cache.
+ return false;
+}
+
+void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplicationCache)
+{
+ ASSERT(!m_domApplicationCache || !domApplicationCache);
+ m_domApplicationCache = domApplicationCache;
+}
+
+void ApplicationCacheHost::notifyEventListener(EventID id)
+{
+ if (m_domApplicationCache)
+ m_domApplicationCache->callEventListener(id);
+}
+
+ApplicationCacheHost::Status ApplicationCacheHost::status() const
+{
+ return m_internal ? static_cast<Status>(m_internal->m_outerHost->status()) : UNCACHED;
+}
+
+bool ApplicationCacheHost::update()
+{
+ return m_internal ? m_internal->m_outerHost->startUpdate() : false;
+}
+
+bool ApplicationCacheHost::swapCache()
+{
+ return m_internal ? m_internal->m_outerHost->swapCache() : false;
+}
+
+bool ApplicationCacheHost::isApplicationCacheEnabled()
+{
+ ASSERT(m_documentLoader->frame());
+ return m_documentLoader->frame()->settings()
+ && m_documentLoader->frame()->settings()->offlineWebApplicationCacheEnabled();
+}
+
+// Ensure that our publicly defined enum values never get out of sync with the
+// ones declared for use within WebCore.
+#define COMPILE_ASSERT_MATCHING_ENUM(webcoreName, publicName) \
+ COMPILE_ASSERT(int(ApplicationCacheHost::webcoreName) == int(WebApplicationCacheHost::publicName), webcoreName)
+
+COMPILE_ASSERT_MATCHING_ENUM(UNCACHED, Uncached);
+COMPILE_ASSERT_MATCHING_ENUM(IDLE, Idle);
+COMPILE_ASSERT_MATCHING_ENUM(CHECKING, Checking);
+COMPILE_ASSERT_MATCHING_ENUM(DOWNLOADING, Downloading);
+COMPILE_ASSERT_MATCHING_ENUM(UPDATEREADY, UpdateReady);
+COMPILE_ASSERT_MATCHING_ENUM(OBSOLETE, Obsolete);
+COMPILE_ASSERT_MATCHING_ENUM(CHECKING_EVENT, CheckingEvent);
+COMPILE_ASSERT_MATCHING_ENUM(ERROR_EVENT, ErrorEvent);
+COMPILE_ASSERT_MATCHING_ENUM(NOUPDATE_EVENT, NoUpdateEvent);
+COMPILE_ASSERT_MATCHING_ENUM(DOWNLOADING_EVENT, DownloadingEvent);
+COMPILE_ASSERT_MATCHING_ENUM(PROGRESS_EVENT, ProgressEvent);
+COMPILE_ASSERT_MATCHING_ENUM(UPDATEREADY_EVENT, UpdateReadyEvent);
+COMPILE_ASSERT_MATCHING_ENUM(CACHED_EVENT, CachedEvent);
+COMPILE_ASSERT_MATCHING_ENUM(OBSOLETE_EVENT, ObsoleteEvent);
+
+} // namespace WebCore
+
+#endif // ENABLE(OFFLINE_WEB_APPLICATIONS)
diff --git a/webkit/api/src/WebSettingsImpl.cpp b/webkit/api/src/WebSettingsImpl.cpp
index 948f80c..e66fb98 100644
--- a/webkit/api/src/WebSettingsImpl.cpp
+++ b/webkit/api/src/WebSettingsImpl.cpp
@@ -230,9 +230,9 @@ void WebSettingsImpl::setTextDirectionSubmenuInclusionBehaviorNeverIncluded()
m_settings->setTextDirectionSubmenuInclusionBehavior(WebCore::TextDirectionSubmenuNeverIncluded);
}
-void WebSettingsImpl::setOfflineWebApplicationCacheEnabled(bool allow)
+void WebSettingsImpl::setOfflineWebApplicationCacheEnabled(bool enabled)
{
- m_settings->setOfflineWebApplicationCacheEnabled(allow);
+ m_settings->setOfflineWebApplicationCacheEnabled(enabled);
}
} // namespace WebKit
diff --git a/webkit/build/V8Bindings/build-generated-files.sh b/webkit/build/V8Bindings/build-generated-files.sh
index beb8a0a..5f56159 100755
--- a/webkit/build/V8Bindings/build-generated-files.sh
+++ b/webkit/build/V8Bindings/build-generated-files.sh
@@ -43,7 +43,7 @@ export ENCODINGS_PREFIX=""
# To see what FEATURE_DEFINES Apple uses, look at:
# webkit/third_party/WebCore/Configurations/WebCore.xcconfig
-export FEATURE_DEFINES="ENABLE_DATABASE ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_CHANNEL_MESSAGING ENABLE_XPATH ENABLE_XSLT"
+export FEATURE_DEFINES="ENABLE_DATABASE ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_CHANNEL_MESSAGING ENABLE_XPATH ENABLE_XSLT"
# Adjust the number of jobs spawned according to the CPU count.
if [ -z "$NUMBER_OF_PROCESSORS" ]; then
diff --git a/webkit/glue/chrome_client_impl.h b/webkit/glue/chrome_client_impl.h
index a6cf956..81ed8eb 100644
--- a/webkit/glue/chrome_client_impl.h
+++ b/webkit/glue/chrome_client_impl.h
@@ -6,6 +6,7 @@
#define WEBKIT_GLUE_CHROME_CLIENT_IMPL_H_
#include "base/compiler_specific.h"
+#include "base/logging.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "ChromeClientChromium.h"
@@ -125,6 +126,10 @@ class ChromeClientImpl : public WebCore::ChromeClientChromium {
virtual void exceededDatabaseQuota(WebCore::Frame*,
const WebCore::String& databaseName);
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) { NOTREACHED(); }
+#endif
+
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*) { }
virtual void runOpenPanel(WebCore::Frame*,
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index 5b1669b..fc09b18 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -20,6 +20,8 @@
#include "webkit/glue/webplugininfo.h"
#include "webkit/glue/weburlloader_impl.h"
+using WebKit::WebApplicationCacheHost;
+using WebKit::WebApplicationCacheHostClient;
using WebKit::WebData;
using WebKit::WebLocalizedString;
using WebKit::WebPluginListBuilder;
@@ -86,6 +88,11 @@ WebKitClientImpl::WebKitClientImpl()
shared_timer_func_(NULL) {
}
+WebApplicationCacheHost* WebKitClientImpl::createApplicationCacheHost(
+ WebApplicationCacheHostClient*) {
+ return NULL;
+}
+
WebThemeEngine* WebKitClientImpl::themeEngine() {
#if defined(OS_WIN)
return &theme_engine_;
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index 8b6574e..2049753 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -57,6 +57,9 @@ class WebKitClientImpl : public WebKit::WebKitClient {
const WebKit::WebString& path, const WebKit::WebString& component);
virtual bool makeAllDirectories(const WebKit::WebString& path);
+ virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
+ WebKit::WebApplicationCacheHostClient*);
+
private:
void DoTimeout() {
if (shared_timer_func_)
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 9cd407c..41fc582 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -425,7 +425,7 @@ void TestShell::ResetWebPreferences() {
web_prefs_->remote_fonts_enabled = true;
web_prefs_->local_storage_enabled = true;
web_prefs_->session_storage_enabled = true;
- web_prefs_->application_cache_enabled = true;
+ web_prefs_->application_cache_enabled = false;
}
}
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 07d4447..c9028c2 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -8,6 +8,7 @@
'ENABLE_CHANNEL_MESSAGING=1',
'ENABLE_DATABASE=1',
'ENABLE_DATAGRID=0',
+ 'ENABLE_OFFLINE_WEB_APPLICATIONS=1',
'ENABLE_DASHBOARD_SUPPORT=0',
'ENABLE_DOM_STORAGE=1',
'ENABLE_JAVASCRIPT_DEBUGGER=0',
@@ -611,8 +612,10 @@
# JSC-only.
['exclude', '/third_party/WebKit/WebCore/inspector/JavaScript[^/]*\\.cpp$'],
- # ENABLE_OFFLINE_WEB_APPLICATIONS only.
+ # ENABLE_OFFLINE_WEB_APPLICATIONS, exclude most of webcore's impl
['exclude', '/third_party/WebKit/WebCore/loader/appcache/'],
+ ['include', '/third_party/WebKit/WebCore/loader/appcache/ApplicationCacheHost\.h$'],
+ ['include', '/third_party/WebKit/WebCore/loader/appcache/DOMApplicationCache\.(h|cpp|idl)$'],
# SVG_FILTERS only.
['exclude', '/third_party/WebKit/WebCore/(platform|svg)/graphics/filters/'],
@@ -631,9 +634,6 @@
# JSC-only.
'../third_party/WebKit/WebCore/inspector/JavaScriptCallFrame.idl',
- # ENABLE_OFFLINE_WEB_APPLICATIONS only.
- '../third_party/WebKit/WebCore/loader/appcache/DOMApplicationCache.idl',
-
# ENABLE_GEOLOCATION only.
'../third_party/WebKit/WebCore/page/Geolocation.idl',
'../third_party/WebKit/WebCore/page/Geoposition.idl',
@@ -975,6 +975,8 @@
'api/public/x11/WebScreenInfoFactory.h',
'api/public/mac/WebInputEventFactory.h',
'api/public/mac/WebScreenInfoFactory.h',
+ 'api/public/WebApplicationCacheHost.h',
+ 'api/public/WebApplicationCacheHostClient.h',
'api/public/WebBindings.h',
'api/public/WebCache.h',
'api/public/WebCanvas.h',
@@ -1036,6 +1038,7 @@
'api/public/win/WebSandboxSupport.h',
'api/public/win/WebScreenInfoFactory.h',
'api/public/win/WebScreenInfoFactory.h',
+ 'api/src/ApplicationCacheHost.cpp',
'api/src/ChromiumBridge.cpp',
'api/src/ChromiumCurrentTime.cpp',
'api/src/ChromiumThreading.cpp',