OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webworkerclient_proxy.h" | 5 #include "content/worker/webworkerclient_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/file_system/file_system_dispatcher.h" | 10 #include "content/common/file_system/file_system_dispatcher.h" |
11 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 11 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
12 #include "content/common/webmessageportchannel_impl.h" | 12 #include "content/common/webmessageportchannel_impl.h" |
13 #include "content/common/worker_messages.h" | 13 #include "content/common/worker_messages.h" |
14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 // TODO(jam): uncomment this and WebWorkerClientProxy::createWorker when the | 15 // TODO(jam): uncomment this and WebWorkerClientProxy::createWorker when the |
16 // renderer worker code moves to content. This code isn't used now since we | 16 // renderer worker code moves to content. This code isn't used now since we |
17 // don't support nested workers anyways. | 17 // don't support nested workers anyways. |
18 //#include "content/renderer/webworker_proxy.h" | 18 //#include "content/renderer/webworker_proxy.h" |
19 #include "content/worker/shared_worker_devtools_agent.h" | 19 #include "content/worker/shared_worker_devtools_agent.h" |
20 #include "content/worker/websharedworker_stub.h" | 20 #include "content/worker/websharedworker_stub.h" |
21 #include "content/worker/worker_thread.h" | 21 #include "content/worker/worker_thread.h" |
22 #include "content/worker/worker_webapplicationcachehost_impl.h" | 22 #include "content/worker/worker_webapplicationcachehost_impl.h" |
23 #include "ipc/ipc_logging.h" | 23 #include "ipc/ipc_logging.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback
s.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h" |
31 | 31 |
32 using WebKit::WebApplicationCacheHost; | 32 using WebKit::WebApplicationCacheHost; |
33 using WebKit::WebFrame; | 33 using WebKit::WebFrame; |
34 using WebKit::WebMessagePortChannel; | 34 using WebKit::WebMessagePortChannel; |
35 using WebKit::WebMessagePortChannelArray; | 35 using WebKit::WebMessagePortChannelArray; |
36 using WebKit::WebSecurityOrigin; | 36 using WebKit::WebSecurityOrigin; |
37 using WebKit::WebString; | 37 using WebKit::WebString; |
38 using WebKit::WebWorker; | 38 using WebKit::WebWorker; |
39 using WebKit::WebWorkerClient; | 39 using WebKit::WebWorkerClient; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // This shuts down the process cleanly from the perspective of the browser | 208 // This shuts down the process cleanly from the perspective of the browser |
209 // process, and avoids the crashed worker infobar from appearing to the new | 209 // process, and avoids the crashed worker infobar from appearing to the new |
210 // page. It's ok to post several of theese, because the first executed task | 210 // page. It's ok to post several of theese, because the first executed task |
211 // will exit the message loop and subsequent ones won't be executed. | 211 // will exit the message loop and subsequent ones won't be executed. |
212 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 212 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
213 base::Bind( | 213 base::Bind( |
214 &WebWorkerClientProxy::workerContextDestroyed, | 214 &WebWorkerClientProxy::workerContextDestroyed, |
215 weak_factory_.GetWeakPtr()), | 215 weak_factory_.GetWeakPtr()), |
216 kMaxTimeForRunawayWorkerMs); | 216 kMaxTimeForRunawayWorkerMs); |
217 } | 217 } |
OLD | NEW |