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

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
Index: content/worker/websharedworkerclient_proxy.cc
diff --git a/content/worker/websharedworkerclient_proxy.cc b/content/worker/websharedworkerclient_proxy.cc
index 1e8c92fad295338d9a6826416a0abfe1e9e124b9..799d5e9896e165af2c074ad4a83df48c98278c66 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,24 @@ void WebSharedWorkerClientProxy::workerContextDestroyed() {
stub_->Shutdown();
}
+void WebSharedWorkerClientProxy::workerScriptLoaded() {
+ if (stub_)
+ stub_->workerScriptLoaded();
+}
+
+void WebSharedWorkerClientProxy::workerScriptLoadFailed() {
+ if (stub_)
+ stub_->workerScriptLoadFailed();
+}
+
+void WebSharedWorkerClientProxy::selectAppChacheID(long long app_cache_id) {
+ if (app_cache_host_) {
kinuko 2013/12/20 05:29:39 app_cache_host_ could become stale as it's owned b
horo 2013/12/20 07:31:42 Done.
+ 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 +88,13 @@ WebSharedWorkerClientProxy::notificationPresenter() {
WebApplicationCacheHost* WebSharedWorkerClientProxy::createApplicationCacheHost(
blink::WebApplicationCacheHostClient* client) {
kinuko 2013/12/20 05:29:39 DCHECK(!app_cache_host_) ?
horo 2013/12/20 07:31:42 Done.
- WorkerWebApplicationCacheHostImpl* 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*

Powered by Google App Engine
This is Rietveld 408576698