OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/worker/websharedworkerclient_proxy.h" | 5 #include "content/worker/websharedworkerclient_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "content/common/fileapi/file_system_dispatcher.h" | 10 #include "content/common/fileapi/file_system_dispatcher.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 bool WebSharedWorkerClientProxy::Send(IPC::Message* message) { | 201 bool WebSharedWorkerClientProxy::Send(IPC::Message* message) { |
202 return WorkerThread::current()->Send(message); | 202 return WorkerThread::current()->Send(message); |
203 } | 203 } |
204 | 204 |
205 void WebSharedWorkerClientProxy::EnsureWorkerContextTerminates() { | 205 void WebSharedWorkerClientProxy::EnsureWorkerContextTerminates() { |
206 // This shuts down the process cleanly from the perspective of the browser | 206 // This shuts down the process cleanly from the perspective of the browser |
207 // process, and avoids the crashed worker infobar from appearing to the new | 207 // process, and avoids the crashed worker infobar from appearing to the new |
208 // page. It's ok to post several of theese, because the first executed task | 208 // page. It's ok to post several of theese, because the first executed task |
209 // will exit the message loop and subsequent ones won't be executed. | 209 // will exit the message loop and subsequent ones won't be executed. |
210 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 210 base::MessageLoop::current()->PostDelayedTask( |
211 base::Bind( | 211 FROM_HERE, |
212 &WebSharedWorkerClientProxy::workerContextDestroyed, | 212 base::Bind(&WebSharedWorkerClientProxy::workerContextDestroyed, |
213 weak_factory_.GetWeakPtr()), | 213 weak_factory_.GetWeakPtr()), |
214 base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds)); | 214 base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds)); |
215 } | 215 } |
216 | 216 |
217 } // namespace content | 217 } // namespace content |
OLD | NEW |