| Index: content/worker/websharedworkerclient_proxy.cc
|
| diff --git a/content/worker/websharedworkerclient_proxy.cc b/content/worker/websharedworkerclient_proxy.cc
|
| index 8175b003a5e77f733d93c081f44ccfe9f79d45a4..538657df28ad6b40f611ca0bff8292e721e9eba1 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. This method is assumed to be called while it's valid.
|
| + 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*
|
|
|