| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/worker/webworkerclient_proxy.h" | 5 #include "chrome/worker/webworkerclient_proxy.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/file_system/file_system_dispatcher.h" | 10 #include "chrome/common/file_system/file_system_dispatcher.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if (stub_) | 110 if (stub_) |
| 111 stub_->Shutdown(); | 111 stub_->Shutdown(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 WebKit::WebWorker* WebWorkerClientProxy::createWorker( | 114 WebKit::WebWorker* WebWorkerClientProxy::createWorker( |
| 115 WebKit::WebWorkerClient* client) { | 115 WebKit::WebWorkerClient* client) { |
| 116 return new WebWorkerProxy(client, WorkerThread::current(), | 116 return new WebWorkerProxy(client, WorkerThread::current(), |
| 117 0, appcache_host_id_); | 117 0, appcache_host_id_); |
| 118 } | 118 } |
| 119 | 119 |
| 120 WebKit::WebNotificationPresenter* |
| 121 WebWorkerClientProxy::notificationPresenter() { |
| 122 // TODO(johnnyg): Notifications are not yet hooked up to workers. |
| 123 // Coming soon. |
| 124 NOTREACHED(); |
| 125 return NULL; |
| 126 } |
| 127 |
| 120 WebApplicationCacheHost* WebWorkerClientProxy::createApplicationCacheHost( | 128 WebApplicationCacheHost* WebWorkerClientProxy::createApplicationCacheHost( |
| 121 WebKit::WebApplicationCacheHostClient* client) { | 129 WebKit::WebApplicationCacheHostClient* client) { |
| 122 WorkerWebApplicationCacheHostImpl* host = | 130 WorkerWebApplicationCacheHostImpl* host = |
| 123 new WorkerWebApplicationCacheHostImpl(stub_->appcache_init_info(), | 131 new WorkerWebApplicationCacheHostImpl(stub_->appcache_init_info(), |
| 124 client); | 132 client); |
| 125 // Remember the id of the instance we create so we have access to that | 133 // Remember the id of the instance we create so we have access to that |
| 126 // value when creating nested dedicated workers in createWorker. | 134 // value when creating nested dedicated workers in createWorker. |
| 127 appcache_host_id_ = host->host_id(); | 135 appcache_host_id_ = host->host_id(); |
| 128 return host; | 136 return host; |
| 129 } | 137 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 178 |
| 171 // This shuts down the process cleanly from the perspective of the browser | 179 // This shuts down the process cleanly from the perspective of the browser |
| 172 // process, and avoids the crashed worker infobar from appearing to the new | 180 // process, and avoids the crashed worker infobar from appearing to the new |
| 173 // page. It's ok to post several of theese, because the first executed task | 181 // page. It's ok to post several of theese, because the first executed task |
| 174 // will exit the message loop and subsequent ones won't be executed. | 182 // will exit the message loop and subsequent ones won't be executed. |
| 175 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 183 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 176 kill_process_factory_.NewRunnableMethod( | 184 kill_process_factory_.NewRunnableMethod( |
| 177 &WebWorkerClientProxy::workerContextDestroyed), | 185 &WebWorkerClientProxy::workerContextDestroyed), |
| 178 kMaxTimeForRunawayWorkerMs); | 186 kMaxTimeForRunawayWorkerMs); |
| 179 } | 187 } |
| OLD | NEW |