summaryrefslogtreecommitdiffstats
path: root/webkit/tools
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/tools
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/tools')
-rw-r--r--webkit/tools/test_shell/simple_appcache_system.h25
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc15
-rw-r--r--webkit/tools/test_shell/test_shell.gyp1
-rw-r--r--webkit/tools/test_shell/test_shell_webkit_init.h10
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc4
-rw-r--r--webkit/tools/test_shell/test_worker/test_worker_main.cc2
6 files changed, 47 insertions, 10 deletions
diff --git a/webkit/tools/test_shell/simple_appcache_system.h b/webkit/tools/test_shell/simple_appcache_system.h
new file mode 100644
index 0000000..6f53524
--- /dev/null
+++ b/webkit/tools/test_shell/simple_appcache_system.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2009 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_TOOLS_TEST_SHELL_SIMPLE_APPCACHE_SYSTEM_H_
+#define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_APPCACHE_SYSTEM_H_
+
+#include "webkit/appcache/appcache_backend_impl.h"
+#include "webkit/appcache/appcache_frontend_impl.h"
+
+class SimpleAppCacheSystem {
+ public:
+ void Initialize() {
+ backend_impl_.Initialize(NULL, &frontend_impl_);
+ }
+
+ appcache::AppCacheBackend* backend() { return &backend_impl_; }
+ appcache::AppCacheFrontend* frontend() { return &frontend_impl_; }
+
+ private:
+ appcache::AppCacheBackendImpl backend_impl_;
+ appcache::AppCacheFrontendImpl frontend_impl_;
+};
+
+#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_APPCACHE_SYSTEM_H_
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index e1137f8..c27f061 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -46,8 +46,8 @@
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
+#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/glue/resource_loader_bridge.h"
-#include "webkit/glue/webappcachecontext.h"
#include "webkit/tools/test_shell/test_shell_request_context.h"
using webkit_glue::ResourceLoaderBridge;
@@ -101,7 +101,7 @@ struct RequestParams {
GURL referrer;
std::string headers;
int load_flags;
- int app_cache_context_id;
+ int appcache_host_id;
scoped_refptr<net::UploadData> upload;
};
@@ -376,7 +376,8 @@ class RequestProxy : public URLRequest::Delegate,
info->request_time = request->request_time();
info->response_time = request->response_time();
info->headers = request->response_headers();
- info->app_cache_id = WebAppCacheContext::kNoAppCacheId;
+ info->appcache_id = appcache::kNoCacheId;
+ // TODO(michaeln): info->appcache_manifest_url = GURL();
request->GetMimeType(&info->mime_type);
request->GetCharset(&info->charset);
info->content_length = request->GetExpectedContentSize();
@@ -468,7 +469,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge {
const GURL& referrer,
const std::string& headers,
int load_flags,
- int app_cache_context_id)
+ int appcache_host_id)
: params_(new RequestParams),
proxy_(NULL) {
params_->method = method;
@@ -477,7 +478,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge {
params_->referrer = referrer;
params_->headers = headers;
params_->load_flags = load_flags;
- params_->app_cache_context_id = app_cache_context_id;
+ params_->appcache_host_id = appcache_host_id;
}
virtual ~ResourceLoaderBridgeImpl() {
@@ -611,11 +612,11 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create(
int load_flags,
int requestor_pid,
ResourceType::Type request_type,
- int app_cache_context_id,
+ int appcache_host_id,
int routing_id) {
return new ResourceLoaderBridgeImpl(method, url, first_party_for_cookies,
referrer, headers, load_flags,
- app_cache_context_id);
+ appcache_host_id);
}
// Issue the proxy resolve request on the io thread, and wait
diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp
index eadd0b0..ef688dc 100644
--- a/webkit/tools/test_shell/test_shell.gyp
+++ b/webkit/tools/test_shell/test_shell.gyp
@@ -63,6 +63,7 @@
'mock_webclipboard_impl.cc',
'mock_webclipboard_impl.h',
'resource.h',
+ 'simple_appcache_system.h',
'simple_clipboard_impl.cc',
'simple_resource_loader_bridge.cc',
'simple_resource_loader_bridge.h',
diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h
index 9c758c7..2727d6b 100644
--- a/webkit/tools/test_shell/test_shell_webkit_init.h
+++ b/webkit/tools/test_shell/test_shell_webkit_init.h
@@ -16,6 +16,7 @@
#include "webkit/api/public/WebStorageNamespace.h"
#include "webkit/api/public/WebString.h"
#include "webkit/api/public/WebURL.h"
+#include "webkit/appcache/web_application_cache_host_impl.h"
#include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webclipboard_impl.h"
#include "webkit/glue/webkit_glue.h"
@@ -23,6 +24,7 @@
#include "webkit/extensions/v8/gears_extension.h"
#include "webkit/extensions/v8/interval_extension.h"
#include "webkit/tools/test_shell/mock_webclipboard_impl.h"
+#include "webkit/tools/test_shell/simple_appcache_system.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
#include "v8/include/v8.h"
@@ -40,6 +42,7 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
WebKit::enableV8SingleThreadMode();
WebKit::registerExtension(extensions_v8::GearsExtension::Get());
WebKit::registerExtension(extensions_v8::IntervalExtension::Get());
+ appcache_system_.Initialize();
// Load libraries for media and enable the media player.
FilePath module_path;
@@ -144,10 +147,17 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
return WebKit::WebStorageNamespace::createSessionStorageNamespace();
}
+ virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
+ WebKit::WebApplicationCacheHostClient* client) {
+ return new appcache::WebApplicationCacheHostImpl(
+ client, appcache_system_.backend());
+ }
+
private:
webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
MockWebClipboardImpl mock_clipboard_;
webkit_glue::WebClipboardImpl real_clipboard_;
+ SimpleAppCacheSystem appcache_system_;
};
#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 279949a..74916a1 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -32,11 +32,11 @@
#include "webkit/api/public/WebURLError.h"
#include "webkit/api/public/WebURLRequest.h"
#include "webkit/api/public/WebURLResponse.h"
+#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/glue/glue_serialize.h"
#include "webkit/glue/media/buffered_data_source.h"
#include "webkit/glue/media/media_resource_loader_bridge_factory.h"
#include "webkit/glue/media/simple_data_source.h"
-#include "webkit/glue/webappcachecontext.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/glue/webkit_glue.h"
@@ -197,7 +197,7 @@ WebKit::WebMediaPlayer* TestWebViewDelegate::CreateWebMediaPlayer(
"null", // frame origin
"null", // main_frame_origin
base::GetCurrentProcId(),
- WebAppCacheContext::kNoAppCacheContextId,
+ appcache::kNoHostId,
0);
factory->AddFactory(webkit_glue::BufferedDataSource::CreateFactory(
MessageLoop::current(), bridge_factory));
diff --git a/webkit/tools/test_shell/test_worker/test_worker_main.cc b/webkit/tools/test_shell/test_worker/test_worker_main.cc
index aefbccb..02eaf32 100644
--- a/webkit/tools/test_shell/test_worker/test_worker_main.cc
+++ b/webkit/tools/test_shell/test_worker/test_worker_main.cc
@@ -157,7 +157,7 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create(
int load_flags,
int requestor_pid,
ResourceType::Type request_type,
- int app_cache_context_id,
+ int appcache_host_id,
int routing_id) {
return NULL;
}