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

Unified Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 1318643002: Pass the v8::Context through the willDestroyServiceWorkerContextOnWorkerThread event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « content/renderer/service_worker/service_worker_context_client.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_context_client.cc
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc
index 55cf381ce034c50eb5c4d170f7a106005cfd49cb..569f6972131ca604161833c29547701a557173b7 100644
--- a/content/renderer/service_worker/service_worker_context_client.cc
+++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -389,15 +389,16 @@ void ServiceWorkerContextClient::didEvaluateWorkerScript(bool success) {
void ServiceWorkerContextClient::didInitializeWorkerContext(
v8::Local<v8::Context> context,
const blink::WebURL& url) {
- // TODO(annekao): Remove WebURL parameter from Blink (since url and script_url
- // are equal). Also remove m_documentURL from ServiceWorkerGlobalScopeProxy.
- DCHECK_EQ(script_url_, GURL(url));
not at google - send to devlin 2015/08/26 01:17:07 I removed this DCHECK because in order to address
+ // TODO(annekao): Remove WebURL parameter from Blink, it's at best redundant
+ // given |script_url_|, and may be empty in the future.
+ // Also remove m_documentURL from ServiceWorkerGlobalScopeProxy.
GetContentClient()
->renderer()
->DidInitializeServiceWorkerContextOnWorkerThread(context, script_url_);
}
-void ServiceWorkerContextClient::willDestroyWorkerContext() {
+void ServiceWorkerContextClient::willDestroyWorkerContext(
+ v8::Local<v8::Context> context) {
kinuko 2015/08/26 09:04:18 Looking into https://codereview.chromium.org/13108
not at google - send to devlin 2015/08/26 17:29:02 A raw pointer of a v8::Context? How would that hel
kinuko 2015/08/27 00:36:55 I was thinking about using a pointer to 'this', Se
not at google - send to devlin 2015/08/27 15:11:50 I would need to move this into content/public for
// At this point OnWorkerRunLoopStopped is already called, so
// worker_task_runner_->RunsTasksOnCurrentThread() returns false
// (while we're still on the worker thread).
@@ -412,7 +413,7 @@ void ServiceWorkerContextClient::willDestroyWorkerContext() {
g_worker_client_tls.Pointer()->Set(NULL);
GetContentClient()->renderer()->WillDestroyServiceWorkerContextOnWorkerThread(
- script_url_);
+ context, script_url_);
}
void ServiceWorkerContextClient::workerContextDestroyed() {
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.h ('k') | extensions/renderer/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698