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

Side by Side Diff: content/renderer/service_worker/embedded_worker_context_client.cc

Issue 153553008: Wire InstallFinished and add some InstallEvent.waitUntil tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/service_worker/embedded_worker_context_client.h" 5 #include "content/renderer/service_worker/embedded_worker_context_client.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // At this point OnWorkerRunLoopStopped is already called, so 113 // At this point OnWorkerRunLoopStopped is already called, so
114 // worker_task_runner_->RunsTasksOnCurrentThread() returns false 114 // worker_task_runner_->RunsTasksOnCurrentThread() returns false
115 // (while we're still on the worker thread). 115 // (while we're still on the worker thread).
116 script_context_.reset(); 116 script_context_.reset();
117 main_thread_proxy_->PostTask( 117 main_thread_proxy_->PostTask(
118 FROM_HERE, 118 FROM_HERE,
119 base::Bind(&CallWorkerContextDestroyedOnMainThread, 119 base::Bind(&CallWorkerContextDestroyedOnMainThread,
120 embedded_worker_id_)); 120 embedded_worker_id_));
121 } 121 }
122 122
123 void EmbeddedWorkerContextClient::didHandleInstallEvent(int request_id) {
124 DCHECK(script_context_);
125 script_context_->DidHandleInstallEvent(request_id);
126 }
127
123 void EmbeddedWorkerContextClient::OnSendMessageToWorker( 128 void EmbeddedWorkerContextClient::OnSendMessageToWorker(
124 int thread_id, 129 int thread_id,
125 int embedded_worker_id, 130 int embedded_worker_id,
126 int request_id, 131 int request_id,
127 const IPC::Message& message) { 132 const IPC::Message& message) {
128 if (!script_context_) 133 if (!script_context_)
129 return; 134 return;
130 DCHECK_EQ(embedded_worker_id_, embedded_worker_id); 135 DCHECK_EQ(embedded_worker_id_, embedded_worker_id);
131 script_context_->OnMessageReceived(request_id, message); 136 script_context_->OnMessageReceived(request_id, message);
132 } 137 }
133 138
134 void EmbeddedWorkerContextClient::SendWorkerStarted() { 139 void EmbeddedWorkerContextClient::SendWorkerStarted() {
135 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 140 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
136 sender_->Send(new EmbeddedWorkerHostMsg_WorkerStarted( 141 sender_->Send(new EmbeddedWorkerHostMsg_WorkerStarted(
137 WorkerTaskRunner::Instance()->CurrentWorkerId(), 142 WorkerTaskRunner::Instance()->CurrentWorkerId(),
138 embedded_worker_id_)); 143 embedded_worker_id_));
139 } 144 }
140 145
141 } // namespace content 146 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698