Index: content/worker/websharedworkerclient_proxy.cc |
diff --git a/content/worker/websharedworkerclient_proxy.cc b/content/worker/websharedworkerclient_proxy.cc |
index 1e8c92fad295338d9a6826416a0abfe1e9e124b9..210f9b84617ee3e3b9aafb1bd83ef2a6bce0b5a2 100644 |
--- a/content/worker/websharedworkerclient_proxy.cc |
+++ b/content/worker/websharedworkerclient_proxy.cc |
@@ -42,7 +42,8 @@ WebSharedWorkerClientProxy::WebSharedWorkerClientProxy( |
appcache_host_id_(0), |
stub_(stub), |
weak_factory_(this), |
- devtools_agent_(NULL) { |
+ devtools_agent_(NULL), |
+ app_cache_host_(NULL) { |
} |
WebSharedWorkerClientProxy::~WebSharedWorkerClientProxy() { |
@@ -59,6 +60,26 @@ void WebSharedWorkerClientProxy::workerContextDestroyed() { |
stub_->Shutdown(); |
} |
+void WebSharedWorkerClientProxy::workerScriptLoaded() { |
+ if (stub_) |
+ stub_->WorkerScriptLoaded(); |
+} |
+ |
+void WebSharedWorkerClientProxy::workerScriptLoadFailed() { |
+ if (stub_) |
+ stub_->WorkerScriptLoadFailed(); |
+} |
+ |
+void WebSharedWorkerClientProxy::selectAppCacheID(long long app_cache_id) { |
+ if (app_cache_host_) { |
+ // app_cache_host_ could become stale as it's owned by blink's |
+ // DocumentLoader. So we have to call selectAppCacheID while it's valid. |
kinuko
2013/12/20 08:23:21
nit: 'So we have to call selectAppCacheID' -> 'Thi
horo
2013/12/20 08:48:15
Done.
It will be called from WebSharedWorkerImpl i
|
+ app_cache_host_->backend()->SelectCacheForSharedWorker( |
+ app_cache_host_->host_id(), |
+ app_cache_id); |
+ } |
+} |
+ |
blink::WebNotificationPresenter* |
WebSharedWorkerClientProxy::notificationPresenter() { |
// TODO(johnnyg): Notifications are not yet hooked up to workers. |
@@ -69,13 +90,14 @@ WebSharedWorkerClientProxy::notificationPresenter() { |
WebApplicationCacheHost* WebSharedWorkerClientProxy::createApplicationCacheHost( |
blink::WebApplicationCacheHostClient* client) { |
- WorkerWebApplicationCacheHostImpl* host = |
+ DCHECK(!app_cache_host_); |
+ app_cache_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; |
+ appcache_host_id_ = app_cache_host_->host_id(); |
+ return app_cache_host_; |
} |
blink::WebWorkerPermissionClientProxy* |