summaryrefslogtreecommitdiffstats
path: root/chrome/worker/worker_webapplicationcachehost_impl.h
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-08 00:32:44 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-08 00:32:44 +0000
commit07331d79c72e07472722ed527ddfb3ac7f0b2c15 (patch)
tree51093c3e27efb1140d93282fa087723a01d23619 /chrome/worker/worker_webapplicationcachehost_impl.h
parenta0c7147644ac9b90c1730916bdab70d602a40fc9 (diff)
downloadchromium_src-07331d79c72e07472722ed527ddfb3ac7f0b2c15.zip
chromium_src-07331d79c72e07472722ed527ddfb3ac7f0b2c15.tar.gz
chromium_src-07331d79c72e07472722ed527ddfb3ac7f0b2c15.tar.bz2
Add some more IPC plumbing and scaffolding to support having appcache work in workers. Everything is still stubbed out at runtime (runtime feature is still disabled in the worker process, and the values in the IPC messages are all zero'd out).
* Widen the CreateWorker IPC message sent from the browser to the worker process to contain additional data needed to initialize an appcache for that worker. * Add a new worker specific WorkerWebApplicationCacheHostImpl class and instantiate one with the initialization data received in the IPC. * Give the WorkerThread an AppCacheDispatcher. * Propagate the cmd-line argument to disable the appcache to the worker process. * Fixup DEPs to show that chrome/workers depends on webkit/appcache BUG=39368 TEST=thinking about what tests to put together for this CL Review URL: http://codereview.chromium.org/1719007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker/worker_webapplicationcachehost_impl.h')
-rw-r--r--chrome/worker/worker_webapplicationcachehost_impl.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/worker/worker_webapplicationcachehost_impl.h b/chrome/worker/worker_webapplicationcachehost_impl.h
new file mode 100644
index 0000000..59ba2a2
--- /dev/null
+++ b/chrome/worker/worker_webapplicationcachehost_impl.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2010 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 CHROME_WORKER_WORKER_WEBAPPLICATIONCACHEHOST_IMPL_H_
+#define CHROME_WORKER_WORKER_WEBAPPLICATIONCACHEHOST_IMPL_H_
+
+#include "webkit/appcache/web_application_cache_host_impl.h"
+
+// Information used to construct and initialize an appcache host
+// for a worker.
+struct WorkerAppCacheInitInfo {
+ bool is_shared_worker;
+ int parent_process_id;
+ int parent_appcache_host_id; // Only valid for dedicated workers.
+ int64 main_resource_appcache_id; // Only valid for shared workers.
+
+ WorkerAppCacheInitInfo()
+ : is_shared_worker(false), parent_process_id(0),
+ parent_appcache_host_id(0), main_resource_appcache_id(0) {
+ }
+ WorkerAppCacheInitInfo(
+ bool is_shared, int process_id, int host_id, int64 cache_id)
+ : is_shared_worker(is_shared), parent_process_id(process_id),
+ parent_appcache_host_id(host_id), main_resource_appcache_id(cache_id) {
+ }
+};
+
+class WorkerWebApplicationCacheHostImpl
+ : public appcache::WebApplicationCacheHostImpl {
+ public:
+ WorkerWebApplicationCacheHostImpl(
+ const WorkerAppCacheInitInfo& init_info,
+ WebKit::WebApplicationCacheHostClient* client);
+
+ // Main resource loading is different for workers. The resource is
+ // loaded by the creator of the worker rather than the worker itself.
+ virtual void willStartMainResourceRequest(WebKit::WebURLRequest&) {}
+ virtual void didReceiveResponseForMainResource(
+ const WebKit::WebURLResponse&) {}
+ virtual void didReceiveDataForMainResource(const char* data, int len) {}
+ virtual void didFinishLoadingMainResource(bool success) {}
+
+ // Cache selection is also different for workers. We know at construction
+ // time what cache to select and do so then.
+ virtual void selectCacheWithoutManifest() {}
+ virtual bool selectCacheWithManifest(const WebKit::WebURL& manifestURL) {
+ return true;
+ }
+};
+
+#endif // CHROME_WORKER_WORKER_WEBAPPLICATIONCACHEHOST_IMPL_H_