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

Unified Diff: content/worker/websharedworkerclient_proxy.cc

Issue 115713004: Move the worker script loading code to the worker process (phase:2/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « content/worker/websharedworkerclient_proxy.h ('k') | content/worker/worker_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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*
« no previous file with comments | « content/worker/websharedworkerclient_proxy.h ('k') | content/worker/worker_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698