OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); | 183 m_client.reportException(errorMessage, lineNumber, columnNumber, sourceURL); |
184 } | 184 } |
185 | 185 |
186 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(PassRefPtrWillBeRawPtr<
ConsoleMessage> consoleMessage) | 186 void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(PassRefPtrWillBeRawPtr<
ConsoleMessage> consoleMessage) |
187 { | 187 { |
188 m_client.reportConsoleMessage(consoleMessage->source(), consoleMessage->leve
l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur
l()); | 188 m_client.reportConsoleMessage(consoleMessage->source(), consoleMessage->leve
l(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->ur
l()); |
189 } | 189 } |
190 | 190 |
191 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) | 191 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& mes
sage) |
192 { | 192 { |
193 m_document.postInspectorTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWo
rkerImpl::postMessageToPageInspector, &m_embeddedWorker, message)); | 193 m_document.postInspectorTask(createCrossThreadTask(&WebEmbeddedWorkerImpl::p
ostMessageToPageInspector, &m_embeddedWorker, message)); |
194 } | 194 } |
195 | 195 |
196 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) | 196 void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) |
197 { | 197 { |
198 m_client.didEvaluateWorkerScript(success); | 198 m_client.didEvaluateWorkerScript(success); |
199 } | 199 } |
200 | 200 |
201 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) | 201 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted(WorkerGlobalScope*
workerGlobalScope) |
202 { | 202 { |
203 ASSERT(!m_workerGlobalScope); | 203 ASSERT(!m_workerGlobalScope); |
204 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); | 204 m_workerGlobalScope = static_cast<ServiceWorkerGlobalScope*>(workerGlobalSco
pe); |
205 m_client.workerContextStarted(this); | 205 m_client.workerContextStarted(this); |
206 } | 206 } |
207 | 207 |
208 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() | 208 void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() |
209 { | 209 { |
210 m_document.postTask(FROM_HERE, createCrossThreadTask(&WebEmbeddedWorkerImpl:
:terminateWorkerContext, &m_embeddedWorker)); | 210 m_document.postTask(createCrossThreadTask(&WebEmbeddedWorkerImpl::terminateW
orkerContext, &m_embeddedWorker)); |
211 } | 211 } |
212 | 212 |
213 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() | 213 void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() |
214 { | 214 { |
215 m_workerGlobalScope = 0; | 215 m_workerGlobalScope = 0; |
216 m_client.willDestroyWorkerContext(); | 216 m_client.willDestroyWorkerContext(); |
217 } | 217 } |
218 | 218 |
219 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() | 219 void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() |
220 { | 220 { |
221 m_client.workerContextDestroyed(); | 221 m_client.workerContextDestroyed(); |
222 } | 222 } |
223 | 223 |
224 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 224 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
225 : m_embeddedWorker(embeddedWorker) | 225 : m_embeddedWorker(embeddedWorker) |
226 , m_document(document) | 226 , m_document(document) |
227 , m_client(client) | 227 , m_client(client) |
228 , m_workerGlobalScope(0) | 228 , m_workerGlobalScope(0) |
229 { | 229 { |
230 } | 230 } |
231 | 231 |
232 } // namespace blink | 232 } // namespace blink |
OLD | NEW |