Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4451)

Unified Diff: chrome/worker/webworkerclient_proxy.cc

Issue 1719007: Initializing an appcache host in a worker process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/worker/webworkerclient_proxy.h ('k') | chrome/worker/worker_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/worker/webworkerclient_proxy.cc
===================================================================
--- chrome/worker/webworkerclient_proxy.cc (revision 46627)
+++ chrome/worker/webworkerclient_proxy.cc (working copy)
@@ -11,11 +11,13 @@
#include "chrome/renderer/webworker_proxy.h"
#include "chrome/worker/webworker_stub_base.h"
#include "chrome/worker/worker_thread.h"
+#include "chrome/worker/worker_webapplicationcachehost_impl.h"
#include "ipc/ipc_logging.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebWorker.h"
+using WebKit::WebApplicationCacheHost;
using WebKit::WebMessagePortChannel;
using WebKit::WebMessagePortChannelArray;
using WebKit::WebString;
@@ -28,6 +30,7 @@
WebWorkerClientProxy::WebWorkerClientProxy(int route_id,
WebWorkerStubBase* stub)
: route_id_(route_id),
+ appcache_host_id_(0),
stub_(stub),
ALLOW_THIS_IN_INITIALIZER_LIST(kill_process_factory_(this)) {
}
@@ -102,10 +105,21 @@
WebKit::WebWorker* WebWorkerClientProxy::createWorker(
WebKit::WebWorkerClient* client) {
- return new WebWorkerProxy(client, WorkerThread::current(), 0, 0);
- // TODO(michaeln): Fill in the appcache_host_id parameter value.
+ return new WebWorkerProxy(client, WorkerThread::current(),
+ 0, appcache_host_id_);
}
+WebApplicationCacheHost* WebWorkerClientProxy::createApplicationCacheHost(
+ WebKit::WebApplicationCacheHostClient* client) {
+ WorkerWebApplicationCacheHostImpl* host =
+ new WorkerWebApplicationCacheHostImpl(stub_->appcache_init_info(),
+ client);
+ // Remember the id of the instance we create so we have access to that
+ // value when creating nested dedicated workers in createWorker.
+ appcache_host_id_ = host->host_id();
+ return host;
+}
+
bool WebWorkerClientProxy::Send(IPC::Message* message) {
return WorkerThread::current()->Send(message);
}
« no previous file with comments | « chrome/worker/webworkerclient_proxy.h ('k') | chrome/worker/worker_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698